@dialecte/cli 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +40670 -35394
- package/dist/lookups.js +364 -44
- package/dist/schemas/rules.schema.json +23 -1
- package/package.json +15 -2
- package/templates/ci/.github/pull_request_template.md +50 -0
- package/templates/ci/.github/workflows/_build.yml +52 -0
- package/templates/ci/.github/workflows/_check-npm-version.yml +60 -0
- package/templates/ci/.github/workflows/_check.yml +66 -0
- package/templates/ci/.github/workflows/_docs.yml +32 -0
- package/templates/ci/.github/workflows/_extract-version.yml +25 -0
- package/templates/ci/.github/workflows/_install.yml +53 -0
- package/templates/ci/.github/workflows/_publish.yml +55 -0
- package/templates/ci/.github/workflows/_tag-release.yml +30 -0
- package/templates/ci/.github/workflows/_type-perf.yml +36 -0
- package/templates/ci/.github/workflows/ci.yml +82 -0
- package/templates/ci/.github/workflows/publish.yml +57 -0
- package/templates/ci/.nvmrc +1 -0
- package/templates/ci/changes/.gitkeep +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!-- dialecte: `dialecte lot pr` renders this body from the lot's records; text after the kept marker is kept -->
|
|
2
|
+
|
|
3
|
+
### Summary
|
|
4
|
+
|
|
5
|
+
<!-- dialecte:summary -->
|
|
6
|
+
|
|
7
|
+
### Behaviours
|
|
8
|
+
|
|
9
|
+
<!-- dialecte:behaviours -->
|
|
10
|
+
|
|
11
|
+
### Changelog
|
|
12
|
+
|
|
13
|
+
<!-- dialecte:changelog -->
|
|
14
|
+
|
|
15
|
+
### Tests
|
|
16
|
+
|
|
17
|
+
<!-- dialecte:tests -->
|
|
18
|
+
|
|
19
|
+
### Review
|
|
20
|
+
|
|
21
|
+
<!-- dialecte:review -->
|
|
22
|
+
|
|
23
|
+
### Risk and effort
|
|
24
|
+
|
|
25
|
+
<!-- dialecte:risk -->
|
|
26
|
+
|
|
27
|
+
### Overlaps
|
|
28
|
+
|
|
29
|
+
<!-- dialecte:overlaps -->
|
|
30
|
+
|
|
31
|
+
### Depends on
|
|
32
|
+
|
|
33
|
+
<!-- dialecte:depends -->
|
|
34
|
+
|
|
35
|
+
### Issue
|
|
36
|
+
|
|
37
|
+
<!-- dialecte:issue -->
|
|
38
|
+
|
|
39
|
+
### Checklist before requesting a review
|
|
40
|
+
|
|
41
|
+
<!-- dialecte:checklist -->
|
|
42
|
+
|
|
43
|
+
<!-- dialecte:kept -->
|
|
44
|
+
|
|
45
|
+
### Checklist for the reviewer when doing the PR review
|
|
46
|
+
|
|
47
|
+
- [ ] All ACs/goals of the (sub-)issue are fulfilled
|
|
48
|
+
- [ ] The code is reviewed and mistakes, bugs and improvements are found. Clean code principles and code consistency are considered
|
|
49
|
+
- [ ] Tests are complete
|
|
50
|
+
- [ ] Testing locally was considered
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _build
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
workflow_call:
|
|
7
|
+
outputs:
|
|
8
|
+
build-cache-key:
|
|
9
|
+
description: 'Cache key for build output'
|
|
10
|
+
value: ${{ jobs.build.outputs.build-cache-key }}
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-24.04
|
|
15
|
+
|
|
16
|
+
outputs:
|
|
17
|
+
build-cache-key: ${{ steps.cache-build-output.outputs.cache-hit }}
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v6
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v6
|
|
25
|
+
with:
|
|
26
|
+
node-version-file: '.nvmrc'
|
|
27
|
+
cache: 'npm'
|
|
28
|
+
|
|
29
|
+
- name: Restore node_modules cache
|
|
30
|
+
uses: actions/cache@v5
|
|
31
|
+
with:
|
|
32
|
+
path: node_modules
|
|
33
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
|
|
34
|
+
# the install job filled it: a miss stops here, never runs without the locked dependencies
|
|
35
|
+
fail-on-cache-miss: true
|
|
36
|
+
|
|
37
|
+
- name: Extract Version
|
|
38
|
+
id: version
|
|
39
|
+
run: |
|
|
40
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
41
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
42
|
+
|
|
43
|
+
- name: Setup build output cache
|
|
44
|
+
id: cache-build-output
|
|
45
|
+
uses: actions/cache@v5
|
|
46
|
+
with:
|
|
47
|
+
path: dist
|
|
48
|
+
key: ${{ runner.os }}-build-output-${{ hashFiles('**/package-lock.json', '**/src/**', '**/package.json') }}-${{ steps.version.outputs.version }}
|
|
49
|
+
|
|
50
|
+
- name: Build
|
|
51
|
+
run: npm run build
|
|
52
|
+
if: steps.cache-build-output.outputs.cache-hit != 'true'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _check-npm-version
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_call:
|
|
6
|
+
outputs:
|
|
7
|
+
publish:
|
|
8
|
+
description: 'Whether this push publishes its version to npm'
|
|
9
|
+
value: ${{ jobs.check.outputs.publish }}
|
|
10
|
+
dist_tag:
|
|
11
|
+
description: 'The npm dist-tag the version is published under: latest, or next for a pre-release'
|
|
12
|
+
value: ${{ jobs.check.outputs.dist_tag }}
|
|
13
|
+
tag:
|
|
14
|
+
description: 'Whether this push pushes the release tag: after the publish, or alone when npm has the version and its tag is missing'
|
|
15
|
+
value: ${{ jobs.check.outputs.tag }}
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
# Only a push that changes the version acts: its version differs from the main it was pushed onto (the push's
|
|
19
|
+
# `before`); any other push decides from git alone and never asks npm. A version npm lacks is published when it is
|
|
20
|
+
# above npm's latest (a pre-release: above next too, published under next); a lower or equal one, or a release tag
|
|
21
|
+
# without its version on npm, fails the run. A version npm has is never published again: when its release tag is
|
|
22
|
+
# missing, the push tags its own commit. A failed npm or git lookup fails the run (`dialecte ci publish-decision`
|
|
23
|
+
# decides). A merge-queue batch lands as one push: its head is published, which may be a later commit than the one
|
|
24
|
+
# that changed the version. The ruleset keeps the queue at one entry per merge (max_entries_to_merge: 1), so the
|
|
25
|
+
# head is that commit.
|
|
26
|
+
check:
|
|
27
|
+
name: Get Deployed Version
|
|
28
|
+
runs-on: ubuntu-24.04
|
|
29
|
+
outputs:
|
|
30
|
+
publish: ${{ steps.decide.outputs.publish }}
|
|
31
|
+
dist_tag: ${{ steps.decide.outputs.dist_tag }}
|
|
32
|
+
tag: ${{ steps.decide.outputs.tag }}
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout
|
|
35
|
+
uses: actions/checkout@v6
|
|
36
|
+
|
|
37
|
+
- name: Setup Node.js
|
|
38
|
+
uses: actions/setup-node@v6
|
|
39
|
+
with:
|
|
40
|
+
node-version-file: '.nvmrc'
|
|
41
|
+
|
|
42
|
+
# the cli decides: it loads from node_modules, which the install job cached
|
|
43
|
+
- name: Restore node_modules cache
|
|
44
|
+
uses: actions/cache@v5
|
|
45
|
+
with:
|
|
46
|
+
path: node_modules
|
|
47
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
|
|
48
|
+
# the install job filled it: a miss stops here, never runs without the locked dependencies
|
|
49
|
+
fail-on-cache-miss: true
|
|
50
|
+
|
|
51
|
+
- name: Fetch the commit the push started from
|
|
52
|
+
env:
|
|
53
|
+
BEFORE: ${{ github.event.before }}
|
|
54
|
+
run: git fetch --depth=1 origin "$BEFORE"
|
|
55
|
+
|
|
56
|
+
- name: Decide
|
|
57
|
+
id: decide
|
|
58
|
+
env:
|
|
59
|
+
BEFORE: ${{ github.event.before }}
|
|
60
|
+
run: __dialecte_cli__ ci publish-decision
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _check
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
workflow_call:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check:
|
|
10
|
+
runs-on: ubuntu-24.04
|
|
11
|
+
timeout-minutes: 60
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v6
|
|
15
|
+
# the merge commit and its parents: the released changelog check reads the base the change goes onto
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 2
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v6
|
|
21
|
+
with:
|
|
22
|
+
node-version-file: '.nvmrc'
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
|
|
25
|
+
- name: Restore node_modules cache
|
|
26
|
+
uses: actions/cache@v5
|
|
27
|
+
with:
|
|
28
|
+
path: node_modules
|
|
29
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
|
|
30
|
+
# the install job filled it: a miss stops here, never runs without the locked dependencies
|
|
31
|
+
fail-on-cache-miss: true
|
|
32
|
+
|
|
33
|
+
- name: Check the package (its check script)
|
|
34
|
+
run: npm run check
|
|
35
|
+
|
|
36
|
+
# a released CHANGELOG section stays as released: judged against the commit the change goes onto - the queue's
|
|
37
|
+
# base (fetched), else the pull request merge ref's first parent; a dispatched run has no change to judge
|
|
38
|
+
- name: Fetch the base the change goes onto
|
|
39
|
+
if: github.event_name == 'merge_group'
|
|
40
|
+
env:
|
|
41
|
+
BASE: ${{ github.event.merge_group.base_sha }}
|
|
42
|
+
run: git fetch --depth=1 origin "$BASE"
|
|
43
|
+
|
|
44
|
+
- name: Released changelog sections stay as released
|
|
45
|
+
if: github.event_name != 'workflow_dispatch'
|
|
46
|
+
env:
|
|
47
|
+
BASE: ${{ github.event_name == 'merge_group' && github.event.merge_group.base_sha || 'HEAD^1' }}
|
|
48
|
+
run: __dialecte_cli__ changelog check --base "$BASE"
|
|
49
|
+
|
|
50
|
+
# the code rules the commit hook runs, here where --no-verify cannot skip them: over the change, against the same
|
|
51
|
+
# base
|
|
52
|
+
- name: Code rules over the change
|
|
53
|
+
if: github.event_name != 'workflow_dispatch'
|
|
54
|
+
env:
|
|
55
|
+
BASE: ${{ github.event_name == 'merge_group' && github.event.merge_group.base_sha || 'HEAD^1' }}
|
|
56
|
+
run: __dialecte_cli__ rules --base "$BASE"
|
|
57
|
+
#{{if skillsCheck}}
|
|
58
|
+
|
|
59
|
+
# the package's skill pages in step with its code (its skills:check script), where --no-verify cannot skip it
|
|
60
|
+
- name: Skill pages in step with the package (its skills:check script)
|
|
61
|
+
run: npm run skills:check
|
|
62
|
+
#{{end}}
|
|
63
|
+
|
|
64
|
+
# the CI files in step with the template of the cli this package runs (dialecte ci sync writes them)
|
|
65
|
+
- name: CI files in step with the cli template
|
|
66
|
+
run: __dialecte_cli__ ci check
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _docs
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
workflow_call:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
# the docs site builds: a broken page or link is caught before main
|
|
10
|
+
docs:
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
timeout-minutes: 20
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@v6
|
|
19
|
+
with:
|
|
20
|
+
node-version-file: '.nvmrc'
|
|
21
|
+
cache: 'npm'
|
|
22
|
+
|
|
23
|
+
- name: Restore node_modules cache
|
|
24
|
+
uses: actions/cache@v5
|
|
25
|
+
with:
|
|
26
|
+
path: node_modules
|
|
27
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
|
|
28
|
+
# the install job filled it: a miss stops here, never runs without the locked dependencies
|
|
29
|
+
fail-on-cache-miss: true
|
|
30
|
+
|
|
31
|
+
- name: Build the docs
|
|
32
|
+
run: npm run doc:build
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _extract-version
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_call:
|
|
6
|
+
outputs:
|
|
7
|
+
version:
|
|
8
|
+
description: 'The version extracted from the package.json file'
|
|
9
|
+
value: ${{ jobs.extract.outputs.version }}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
extract:
|
|
13
|
+
name: Get Current Version
|
|
14
|
+
runs-on: ubuntu-24.04
|
|
15
|
+
outputs:
|
|
16
|
+
version: ${{ steps.extract-version.outputs.version }}
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v6
|
|
20
|
+
|
|
21
|
+
- name: Extract Version
|
|
22
|
+
id: extract-version
|
|
23
|
+
run: |
|
|
24
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
25
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _install
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
outputs:
|
|
6
|
+
cache-key:
|
|
7
|
+
description: 'Cache key for node_modules'
|
|
8
|
+
value: ${{ jobs.cache-and-install.outputs.cache-key }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
cache-and-install:
|
|
12
|
+
runs-on: ubuntu-24.04
|
|
13
|
+
|
|
14
|
+
outputs:
|
|
15
|
+
cache-key: ${{ steps.cache-node-modules.outputs.cache-hit }}
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v6
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v6
|
|
23
|
+
with:
|
|
24
|
+
node-version-file: '.nvmrc'
|
|
25
|
+
cache: 'npm'
|
|
26
|
+
|
|
27
|
+
- name: Setup node_modules Cache
|
|
28
|
+
id: cache-node-modules
|
|
29
|
+
uses: actions/cache@v5
|
|
30
|
+
with:
|
|
31
|
+
path: node_modules
|
|
32
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: npm ci
|
|
36
|
+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
37
|
+
#{{if playwright}}
|
|
38
|
+
|
|
39
|
+
- name: Get Playwright Version
|
|
40
|
+
id: playwright-version
|
|
41
|
+
run: echo "playwright_version=$(node -e "console.log(require('./package.json').devDependencies['playwright'])")" >> $GITHUB_OUTPUT
|
|
42
|
+
|
|
43
|
+
- name: Setup Playwright Cache
|
|
44
|
+
uses: actions/cache@v5
|
|
45
|
+
id: cache-playwright
|
|
46
|
+
with:
|
|
47
|
+
path: ~/.cache/ms-playwright
|
|
48
|
+
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.playwright_version }}-${{ hashFiles('**/package-lock.json') }}
|
|
49
|
+
|
|
50
|
+
- name: Install Playwright
|
|
51
|
+
if: steps.cache-playwright.outputs.cache-hit != 'true'
|
|
52
|
+
run: npx playwright install chromium --with-deps
|
|
53
|
+
#{{end}}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _publish
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_call:
|
|
6
|
+
inputs:
|
|
7
|
+
# the npm dist-tag to publish under: latest, or next for a pre-release
|
|
8
|
+
dist-tag:
|
|
9
|
+
required: true
|
|
10
|
+
type: string
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-24.04
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
id-token: write
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js
|
|
23
|
+
uses: actions/setup-node@v6
|
|
24
|
+
with:
|
|
25
|
+
node-version-file: '.nvmrc'
|
|
26
|
+
registry-url: 'https://registry.npmjs.org'
|
|
27
|
+
|
|
28
|
+
- name: Extract Version
|
|
29
|
+
id: version
|
|
30
|
+
run: |
|
|
31
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
32
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
33
|
+
|
|
34
|
+
- name: Restore build output cache
|
|
35
|
+
id: restore-cache
|
|
36
|
+
uses: actions/cache@v5
|
|
37
|
+
with:
|
|
38
|
+
path: dist
|
|
39
|
+
key: ${{ runner.os }}-build-output-${{ hashFiles('**/package-lock.json', '**/src/**', '**/package.json') }}-${{ steps.version.outputs.version }}
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies if cache miss
|
|
42
|
+
if: steps.restore-cache.outputs.cache-hit != 'true'
|
|
43
|
+
run: npm ci
|
|
44
|
+
|
|
45
|
+
- name: Build if cache miss
|
|
46
|
+
if: steps.restore-cache.outputs.cache-hit != 'true'
|
|
47
|
+
run: npm run build
|
|
48
|
+
|
|
49
|
+
- name: Verify build output exists
|
|
50
|
+
run: ls -la dist
|
|
51
|
+
|
|
52
|
+
- name: Publish to npm
|
|
53
|
+
env:
|
|
54
|
+
DIST_TAG: ${{ inputs.dist-tag }}
|
|
55
|
+
run: npm publish --access public --tag "$DIST_TAG"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _tag-release
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_call:
|
|
6
|
+
inputs:
|
|
7
|
+
version:
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
secrets:
|
|
11
|
+
github-token:
|
|
12
|
+
required: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v6
|
|
20
|
+
|
|
21
|
+
- name: Create Tag
|
|
22
|
+
run: |
|
|
23
|
+
git config --global user.name "github-actions[bot]"
|
|
24
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
25
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
26
|
+
TAG_PREFIX=$(echo "$PACKAGE_NAME" | sed 's/.*\///')
|
|
27
|
+
git tag "${TAG_PREFIX}@v${{ inputs.version }}"
|
|
28
|
+
git push origin "${TAG_PREFIX}@v${{ inputs.version }}"
|
|
29
|
+
env:
|
|
30
|
+
GITHUB_TOKEN: ${{ secrets.github-token }}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: _type-perf
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
workflow_call:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
type-perf:
|
|
10
|
+
runs-on: ubuntu-24.04
|
|
11
|
+
timeout-minutes: 20
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v6
|
|
15
|
+
|
|
16
|
+
- name: Setup Node.js
|
|
17
|
+
uses: actions/setup-node@v6
|
|
18
|
+
with:
|
|
19
|
+
node-version-file: '.nvmrc'
|
|
20
|
+
cache: 'npm'
|
|
21
|
+
|
|
22
|
+
- name: Restore node_modules cache
|
|
23
|
+
uses: actions/cache@v5
|
|
24
|
+
with:
|
|
25
|
+
path: node_modules
|
|
26
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
|
|
27
|
+
# the install job filled it: a miss stops here, never runs without the locked dependencies
|
|
28
|
+
fail-on-cache-miss: true
|
|
29
|
+
|
|
30
|
+
# fails when the type instantiation counts regress past the baseline's tolerance
|
|
31
|
+
- name: Type-performance regression gate
|
|
32
|
+
run: npm run type-bench:check
|
|
33
|
+
|
|
34
|
+
# fails when a schema-derived narrowing assertion no longer holds
|
|
35
|
+
- name: Type-narrowing gate
|
|
36
|
+
run: npm run type-narrowing --if-present
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: ci
|
|
3
|
+
|
|
4
|
+
# The checks: a pull request and the merge queue run every one. A pull request gets the whole answer early (the tests
|
|
5
|
+
# its own _test.yml runs for mode pr, when it takes one); the queue proves the change on top of main and the changes
|
|
6
|
+
# ahead of it (mode full). The push to main that the queue's merge makes is publish.yml's: it builds and publishes,
|
|
7
|
+
# never tests again.
|
|
8
|
+
on:
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
merge_group:
|
|
14
|
+
|
|
15
|
+
# a new push of a pull request cancels the run it supersedes; queue runs always finish
|
|
16
|
+
concurrency:
|
|
17
|
+
group: ci-${{ github.event_name }}-${{ github.ref }}
|
|
18
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
install:
|
|
22
|
+
name: Install Dependencies
|
|
23
|
+
uses: ./.github/workflows/_install.yml
|
|
24
|
+
|
|
25
|
+
build:
|
|
26
|
+
name: Build Project
|
|
27
|
+
needs: install
|
|
28
|
+
uses: ./.github/workflows/_build.yml
|
|
29
|
+
|
|
30
|
+
check:
|
|
31
|
+
name: Check
|
|
32
|
+
needs: install
|
|
33
|
+
uses: ./.github/workflows/_check.yml
|
|
34
|
+
#{{if typePerf}}
|
|
35
|
+
|
|
36
|
+
type-perf:
|
|
37
|
+
name: Type Gates
|
|
38
|
+
needs: install
|
|
39
|
+
uses: ./.github/workflows/_type-perf.yml
|
|
40
|
+
#{{end}}
|
|
41
|
+
#{{if docs}}
|
|
42
|
+
|
|
43
|
+
docs:
|
|
44
|
+
name: Docs Build
|
|
45
|
+
needs: install
|
|
46
|
+
uses: ./.github/workflows/_docs.yml
|
|
47
|
+
#{{end}}
|
|
48
|
+
|
|
49
|
+
# the repository's own tests: .github/workflows/_test.yml is not the template's
|
|
50
|
+
test:
|
|
51
|
+
name: Run Tests
|
|
52
|
+
needs: install
|
|
53
|
+
uses: ./.github/workflows/_test.yml
|
|
54
|
+
#{{if testMode}}
|
|
55
|
+
with:
|
|
56
|
+
mode: ${{ github.event_name == 'pull_request' && 'pr' || 'full' }}
|
|
57
|
+
#{{end}}
|
|
58
|
+
|
|
59
|
+
# the one check the ruleset requires: green only when every job of this run passed (none failed, cancelled or
|
|
60
|
+
# skipped)
|
|
61
|
+
ci-ok:
|
|
62
|
+
name: ci-ok
|
|
63
|
+
if: always()
|
|
64
|
+
needs:
|
|
65
|
+
- install
|
|
66
|
+
- build
|
|
67
|
+
- check
|
|
68
|
+
#{{if typePerf}}
|
|
69
|
+
- type-perf
|
|
70
|
+
#{{end}}
|
|
71
|
+
#{{if docs}}
|
|
72
|
+
- docs
|
|
73
|
+
#{{end}}
|
|
74
|
+
- test
|
|
75
|
+
runs-on: ubuntu-24.04
|
|
76
|
+
steps:
|
|
77
|
+
- name: Every job passed
|
|
78
|
+
env:
|
|
79
|
+
RESULTS: ${{ join(needs.*.result, ' ') }}
|
|
80
|
+
run: |
|
|
81
|
+
echo "results: $RESULTS"
|
|
82
|
+
for result in $RESULTS; do test "$result" = success; done
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Written by `dialecte ci sync` from the @dialecte/cli template: change the template, not this file.
|
|
2
|
+
name: publish
|
|
3
|
+
|
|
4
|
+
# npm trusted publishing names this file (publish.yml) and its push trigger in every package: never rename it, never
|
|
5
|
+
# change its trigger, or publishing stops.
|
|
6
|
+
# The push to main is the queue's merge of a commit ci.yml already tested: build, then publish and tag when the
|
|
7
|
+
# version changed. No test runs here. Only the push that changes the version publishes it, above npm's latest, and
|
|
8
|
+
# tags it; a re-run pushes a missing tag alone (_check-npm-version.yml). No concurrency group: every push runs to its
|
|
9
|
+
# end, a pending run is never replaced by a later one's.
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches:
|
|
13
|
+
- main
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
install:
|
|
17
|
+
name: Install Dependencies
|
|
18
|
+
uses: ./.github/workflows/_install.yml
|
|
19
|
+
|
|
20
|
+
build:
|
|
21
|
+
name: Build Project
|
|
22
|
+
needs: install
|
|
23
|
+
uses: ./.github/workflows/_build.yml
|
|
24
|
+
|
|
25
|
+
version:
|
|
26
|
+
name: Check Version
|
|
27
|
+
needs: install
|
|
28
|
+
uses: ./.github/workflows/_check-npm-version.yml
|
|
29
|
+
|
|
30
|
+
extract-version:
|
|
31
|
+
name: Extract Version
|
|
32
|
+
uses: ./.github/workflows/_extract-version.yml
|
|
33
|
+
|
|
34
|
+
deploy:
|
|
35
|
+
name: Publish to NPM
|
|
36
|
+
if: needs.version.outputs.publish == 'true'
|
|
37
|
+
needs:
|
|
38
|
+
- build
|
|
39
|
+
- version
|
|
40
|
+
uses: ./.github/workflows/_publish.yml
|
|
41
|
+
with:
|
|
42
|
+
dist-tag: ${{ needs.version.outputs.dist_tag }}
|
|
43
|
+
|
|
44
|
+
create-release-tag:
|
|
45
|
+
name: Create Release Tag
|
|
46
|
+
# after the publish, or alone when the publish is skipped (npm has the version, its tag is missing); never after a
|
|
47
|
+
# failed or cancelled job
|
|
48
|
+
if: ${{ !cancelled() && !failure() && needs.version.outputs.tag == 'true' }}
|
|
49
|
+
needs:
|
|
50
|
+
- version
|
|
51
|
+
- extract-version
|
|
52
|
+
- deploy
|
|
53
|
+
uses: ./.github/workflows/_tag-release.yml
|
|
54
|
+
with:
|
|
55
|
+
version: ${{ needs.extract-version.outputs.version }}
|
|
56
|
+
secrets:
|
|
57
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
26
|
|
File without changes
|