Skip to content

Commit b54ee76

Browse files
committed
ci: reuse shared Node.js test action
1 parent 60741da commit b54ee76

7 files changed

Lines changed: 35 additions & 39 deletions

‎.github/workflows/__test-action-lint.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ jobs:
1616
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
1717
with:
1818
persist-credentials: false
19-
- name: Arrange - Install the contract test runtime
20-
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
21-
with:
22-
node-version-file: .node-version
23-
cache: npm
24-
- name: Arrange - Install contract test dependencies
25-
run: npm ci --ignore-scripts
2619
- name: Assert - Action contract tests pass
27-
run: node --test actions/lint/action.test.cjs
20+
uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0
21+
with:
22+
command: test:ci
23+
arguments: '["actions/lint/action.test.cjs"]'
24+
coverage: ""
25+
comment: "false"
2826
- name: Arrange - Install the project runtime and dependencies
2927
uses: $/actions/setup-python
3028
with:

‎.github/workflows/__test-action-parse-ci-reports.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ jobs:
1515
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
1616
with:
1717
persist-credentials: false
18-
- name: Arrange - Install the contract test runtime
19-
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
20-
with:
21-
node-version-file: .node-version
22-
cache: npm
23-
- name: Arrange - Install contract test dependencies
24-
run: npm ci --ignore-scripts
2518
- name: Assert - Action contract tests pass
26-
run: node --test .github/actions/parse-ci-reports/action.test.cjs
19+
uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0
20+
with:
21+
command: test:ci
22+
arguments: '[".github/actions/parse-ci-reports/action.test.cjs"]'
23+
coverage: ""
24+
comment: "false"
2725
- name: Arrange - Empty report directory
2826
run: mkdir -p "$RUNNER_TEMP/empty-reports"
2927
- name: Act - Retain no reports

‎.github/workflows/__test-action-setup-python.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ jobs:
1414
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
1515
with:
1616
persist-credentials: false
17-
- name: Arrange - Install the contract test runtime
18-
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
19-
with:
20-
node-version-file: .node-version
21-
cache: npm
22-
- name: Arrange - Install contract test dependencies
23-
run: npm ci --ignore-scripts
2417
- name: Assert - Action contract tests pass
25-
run: node --test actions/setup-python/action.test.cjs
18+
uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0
19+
with:
20+
command: test:ci
21+
arguments: '["actions/setup-python/action.test.cjs"]'
22+
coverage: ""
23+
comment: "false"
2624
- name: Act - Detect the runtime and install dependencies
2725
uses: $/actions/setup-python
2826
with:

‎.github/workflows/__test-action-test.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ jobs:
1616
with:
1717
persist-credentials: false
1818
name: Arrange - Check out the repository
19-
- name: Arrange - Install the contract test runtime
20-
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
21-
with:
22-
node-version-file: .node-version
23-
cache: npm
24-
- name: Arrange - Install contract test dependencies
25-
run: npm ci --ignore-scripts
2619
- name: Assert - Action contract tests pass
27-
run: node --test actions/test/action.test.cjs
20+
uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0
21+
with:
22+
command: test:ci
23+
arguments: '["actions/test/action.test.cjs"]'
24+
coverage: ""
25+
comment: "false"
2826
- uses: $/actions/setup-python
2927
with:
3028
working-directory: tests/python-project

‎.github/workflows/__test-workflow-continuous-integration.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
1313
with:
1414
persist-credentials: false
15-
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
16-
with:
17-
node-version-file: .node-version
18-
cache: npm
19-
- run: npm ci --ignore-scripts
2015
- name: Assert - Workflow configuration tests pass
21-
run: node --test tests/*.test.cjs
16+
uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0
17+
with:
18+
command: test:ci
19+
arguments: '["tests/config.test.cjs"]'
20+
coverage: ""
21+
comment: "false"
2222
fixture:
2323
uses: $/.github/workflows/continuous-integration.yml
2424
permissions:

‎docs/development/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ commands, failure propagation and retrieval of retained reports.
5555
`__test-workflow-continuous-integration.yml` runs only the workflow configuration
5656
Node tests and calls the public workflow with real fixture versions and checks
5757
disabled behavior. `__shared-ci.yml` calls all these test workflows.
58+
The [`ci-github-nodejs` test action](https://github.com/hoverkraft-tech/ci-github-nodejs/tree/main/actions/test)
59+
handles Node setup and dependency caching, installs locked dependencies with
60+
lifecycle scripts disabled, and runs `test:ci` with the suite path from `arguments`.
5861
These GitHub runner/artifact boundaries cannot be covered by local unit tests.
5962
The fixture is deliberately small; it validates action wiring rather than the
6063
language's arithmetic implementation.

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"private": true,
44
"description": "Development-only tests for GitHub Actions configuration",
55
"scripts": {
6-
"test": "node --test tests/*.test.cjs actions/*/*.test.cjs .github/actions/*/*.test.cjs"
6+
"test": "node --test tests/*.test.cjs actions/*/*.test.cjs .github/actions/*/*.test.cjs",
7+
"test:ci": "node --test"
78
},
89
"devDependencies": {
910
"yaml": "2.9.1"

0 commit comments

Comments
 (0)