Skip to content

Commit aa74e81

Browse files
committed
ci: run the doctor suite on pull requests
Its 82 tests only ran through the release workflow's prepack, so a regression there surfaced while cutting a release rather than on the pull request that caused it - the same gap the CLI had before its own test workflow existed. No darwin leg: unlike the CLI suites these stub the platform through a fake HostInfo rather than probing it, so a second OS would run identical assertions. The package's lockfile is now committed rather than ignored, which is what lets CI use npm ci and cache by its hash. Without it installs were resolved fresh on every run, so a transitive release could break the build with no change to the repository.
1 parent 10966fc commit aa74e81

3 files changed

Lines changed: 2584 additions & 1 deletion

File tree

.github/workflows/tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,40 @@ jobs:
5454

5555
- name: Test
5656
run: npm test
57+
58+
doctor:
59+
name: Doctor (Node ${{ matrix.node-version }})
60+
runs-on: ubuntu-latest
61+
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
# No darwin leg: unlike the CLI suites, these stub the platform through
66+
# a fake HostInfo rather than probing it, so a second OS runs identical
67+
# assertions.
68+
node-version: [ '20.x', '22.x', '24.x' ]
69+
70+
steps:
71+
72+
- name: Harden the runner (Audit all outbound calls)
73+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
74+
with:
75+
egress-policy: audit
76+
77+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
78+
with:
79+
persist-credentials: false
80+
81+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
82+
with:
83+
node-version: ${{ matrix.node-version }}
84+
cache: 'npm'
85+
cache-dependency-path: packages/doctor/package-lock.json
86+
87+
- name: Install
88+
working-directory: packages/doctor
89+
run: npm ci
90+
91+
- name: Test
92+
working-directory: packages/doctor
93+
run: npm test

packages/doctor/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ build/Release
2626
# Dependency directories
2727
node_modules
2828
jspm_packages
29-
package-lock.json
3029

3130
# Optional npm cache directory
3231
.npm

0 commit comments

Comments
 (0)