Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .claude/skills/template-sync/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ own customizations or drifts from its template.
- **`.github/workflows/template-sync.yml` — the template, always.** It carries
no per-repo values: `TEMPLATE_REPO_URL` and `TEMPLATE_SYNC_STRATEGY` are
repo variables, so it cannot legitimately differ from the parent's.
- **`.github/workflows/continuous-integration.yml` — the template in a
template layer, the leaf in a leaf.** The test runner discovers its files,
so a template layer's copy cannot legitimately differ from the parent's.
A leaf has no `scripts/` — scaffolding deleted the template's workflow
with them — so the one it carries is its own; keep it.
- **`.github/workflows/test-scripts.yml` — the template, always.** The test
runner discovers its files, so a template layer's copy cannot legitimately
differ from the parent's. A leaf has no `scripts/` — scaffolding deletes
this workflow along with them, so a leaf never carries this file at all.
- **`.github/workflows/continuous-integration.yml` — owned locally, if it
exists at all.** Not shipped by the template. A leaf (or a template layer
generating one for the leaves it scaffolds) authors its own product
build/test/pack pipeline under this name; keep the local copy.
- **`README.md` — split.** This repo owns the diagram highlight and its own
tables; the template owns the shared structure.
- **`LICENSE` — this repo**, if it is private and carries the proprietary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
# *.Tests.ps1 itself, so this file lists nothing and stays identical at every
# template layer. A leaf has no scripts/, so this is a clean no-op there.

name: Continuous Integration
name: Test Scripts

on:
pull_request:
paths:
- scripts/**
- .github/workflows/continuous-integration.yml
- .github/workflows/test-scripts.yml

# Can be triggered manually
workflow_dispatch:

# A newer push to the same branch supersedes a run still in progress.
concurrency:
group: continuous-integration-${{ github.ref }}
group: test-scripts-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ workflow below marked *via* is a thin trigger that calls one.
| :---------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- |
| 📁[.github/][githubFolder] | |
|  └─📁[workflows/][workflowFolder] | |
|        ├─📄[Continuous Integration][ciWorkflow] | Runs the [scaffolding scripts'][scriptsFile] tests on both platforms |
|        ├─📄[Draft Release][draftWorkflow] | Entry point for [cutting a release][releaseFile], via [TaffarelJr/.actions][actionsRepo] |
|        ├─📄[Template Sync][syncWorkflow] | Brings changes from a template repo, via [TaffarelJr/.actions][actionsRepo] |
|        ├─📄[Test Scripts][testScriptsWorkflow] | Runs the [scaffolding scripts'][scriptsFile] tests on both platforms |
|        └─📄[Validate Codecov][codecovWorkflow] | Checks `codecov.yml` against Codecov's validator, via [TaffarelJr/.actions][actionsRepo] |

### Other Files
Expand Down Expand Up @@ -172,9 +172,9 @@ workflow below marked *via* is a thin trigger that calls one.
[issueFormsFolder]: ./.github/ISSUE_TEMPLATE/
[issueChooserFile]: ./.github/ISSUE_TEMPLATE/config.yml
[workflowFolder]: ./.github/workflows/
[ciWorkflow]: ./.github/workflows/continuous-integration.yml
[draftWorkflow]: ./.github/workflows/draft-release.yml
[syncWorkflow]: ./.github/workflows/template-sync.yml
[testScriptsWorkflow]: ./.github/workflows/test-scripts.yml
[codecovWorkflow]: ./.github/workflows/validate-codecov.yml
[codeOwnFile]: ./.github/CODEOWNERS
[codecovFile]: ./.github/codecov.yml
Expand Down
13 changes: 8 additions & 5 deletions docs/TemplateChain.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,14 @@ Resolve by taking the incoming structure and re-applying the local keys.

- **Repo settings — this repo.** It declares only its own deltas;
the rest is inherited through `_extends` at runtime, not through the file.
- **The CI workflow — the template, until a layer builds something.**
The base's runs the scaffolding scripts' tests, and the runner discovers
each layer's own test files, so a template layer runs it verbatim.
A leaf has no scripts: scaffolding deletes the workflow along with them,
and the leaf writes its own — which is where its toolchain lives.
- **`test-scripts.yml` — the template, always.** It runs the scaffolding
scripts' own tests, and the runner discovers each layer's own test files,
so a template layer runs it verbatim. A leaf has no scripts: scaffolding
deletes this workflow along with them.
- **`continuous-integration.yml` — owned locally, if it exists at all.**
Not shipped by the template — a leaf (or a template layer generating one
for the leaves it scaffolds) writes its own here, which is where its
toolchain lives.
- **The publish workflow — this layer.** What happens when a release is
published is the layer's own business, so a layer with something to do
at that moment carries its own `publish-release.yml`,
Expand Down
4 changes: 2 additions & 2 deletions scripts/New-Repo-Files.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function Remove-TemplateOnlyFile {
function Remove-ScriptsFolder {
<#
.SYNOPSIS
Deletes the scripts/ folder and its CI workflow in a code repo, since
Deletes the scripts/ folder and test-scripts.yml in a code repo, since
nothing is derived from one and there is nothing left to test.
#>
param(
Expand All @@ -83,7 +83,7 @@ function Remove-ScriptsFolder {

Write-Doing 'Removing scripts/'
$dir = Join-Path $RepoPath 'scripts'
$workflow = Join-Path $RepoPath '.github/workflows/continuous-integration.yml'
$workflow = Join-Path $RepoPath '.github/workflows/test-scripts.yml'
if (-not (Test-Path $dir) -and -not (Test-Path $workflow)) {
Write-Done -Skip 'already removed'
return
Expand Down
4 changes: 2 additions & 2 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ Each `*.Tests.ps1` runs in its own PowerShell process on the shared
never leak between files. `Common-Git` is the slow one: it drives real
`git` repos, because nothing else can vouch for what git does.

The [Continuous Integration][ciWorkflow] workflow runs the same suite on
The [Test Scripts][testScriptsWorkflow] workflow runs the same suite on
Ubuntu and Windows for every pull request that touches `scripts/`.

<!-- Source Code URIs (folders first, then files; each alphabetical) -->

[ciWorkflow]: ../.github/workflows/continuous-integration.yml
[testScriptsWorkflow]: ../.github/workflows/test-scripts.yml
[chainFile]: ../docs/TemplateChain.md
6 changes: 3 additions & 3 deletions scripts/tests/New-Repo-Files.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,16 @@ Write-TestSection '9. Remove-ScriptsFolder'
# Arrange
$repo = New-Repo -Name 'scripts-repo'
Write-RepoFile -Repo $repo -Relative 'scripts/x.psm1' -Text 'x'
Write-RepoFile -Repo $repo -Relative '.github/workflows/continuous-integration.yml' -Text 'y'
Write-RepoFile -Repo $repo -Relative '.github/workflows/test-scripts.yml' -Text 'y'
$before = Get-ChangeCount

# Act
Remove-ScriptsFolder -RepoPath $repo 6>$null

# Assert
Assert-That 'scripts/ is gone' (-not (Test-Path (Join-Path $repo 'scripts')))
Assert-That 'and its CI workflow too' `
(-not (Test-Path (Join-Path $repo '.github/workflows/continuous-integration.yml')))
Assert-That 'and test-scripts.yml too' `
(-not (Test-Path (Join-Path $repo '.github/workflows/test-scripts.yml')))
Assert-That 'and it records a change' ((Get-ChangeCount) -gt $before)

# Arrange
Expand Down