ci: read node version from .nvmrc in github workflows (#4919) - #4921
ci: read node version from .nvmrc in github workflows (#4919)#4921NoopDog wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Aligns CI workflows and deploy scripts with the repository’s pinned Node version by using .nvmrc as the single source of truth, reducing drift between tested and deployed artifacts.
Changes:
- Updated GitHub Actions workflows to use
actions/setup-nodewithnode-version-file: ".nvmrc"and enabled npm caching. - Updated deploy scripts to switch Node via
.nvmrcinstead of a hard-coded version. - Updated README prerequisite Node version to match
.nvmrc.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates documented Node prerequisite to reference .nvmrc. |
| cgl-anvil-catalog-prod-deploy.sh | Uses .nvmrc for Node version during prod deploy build. |
| cc-anvil-catalog-dev-deploy.sh | Uses .nvmrc for Node version during dev deploy build. |
| cc-data-browser.lungmap.dev.clevercanary.com-deploy.sh | Uses .nvmrc for Node version during lungmap dev deploy build. |
| cc-explore.anvilproject.dev.clevercanary.com-deploy.sh | Uses .nvmrc for Node version during explore dev deploy build. |
| .github/workflows/run-checks.yml | Reads Node from .nvmrc and enables npm dependency caching. |
| .github/workflows/run-playwright-tests-anvil-catalog.yml | Reads Node from .nvmrc and enables npm dependency caching (including files/). |
| .github/workflows/run-playwright-tests-anvil-cmg.yml | Reads Node from .nvmrc and enables npm dependency caching. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ReviewFirst off — really nice work on this one. The PR does exactly what #4919 asked for and does it cleanly: A code review pass (with adversarial verification) surfaced three findings worth considering before merge: 1.
|
Closes #4919
What changed
run-checks.yml,run-playwright-tests-anvil-catalog.yml,run-playwright-tests-anvil-cmg.yml:actions/setup-nodenow usesnode-version-file: ".nvmrc"instead of a hard-codednode-version: "22.12.0", and enables npm caching (cache: "npm"). The two workflows that installfiles/dependencies key the cache on both lockfiles; anvil-cmg keys on the root lockfile only, since it never installsfiles/.cgl-anvil-catalog-prod-deploy.sh,cc-anvil-catalog-dev-deploy.sh,cc-data-browser.lungmap.dev.clevercanary.com-deploy.sh,cc-explore.anvilproject.dev.clevercanary.com-deploy.sh):n 22.12.0→n $(cat .nvmrc), so deploys build on the same Node CI tests.README.md: prerequisite updated from 22.12.0 to 22.13.0 with a pointer to.nvmrc.Why
CI had drifted to Node 22.12.0 while the repo's pin (
package.jsonengines,.gitlab/Dockerfile, and.nvmrcfrom #4918) is 22.13.0 — and the deploy scripts had drifted the same way, so production artifacts were built on a Node version CI never tested. Reading.nvmrceverywhere makes it the single source of truth: a future Node bump touches.nvmrc,engines, and the GitLab Dockerfile, and CI plus deploys follow automatically. Matches the convention in clevercanary/hca-atlas-tracker. Completes the remaining workflows item from #4876.Assumptions I made
./outandnpm cirelative to it), so$(cat .nvmrc)resolves.How to verify
Definition of done from #4919, mapped to steps:
.nvmrc— open the "Run checks" run for this PR, expand thesetup-nodestep, and confirm it logsResolved .nvmrc as 22.13.0and installs Node 22.13.0 (not 22.12.0). Repeat for either Playwright workflow run.grep -rn "node-version:" .github/workflows/returns nothing; onlynode-version-fileremains.setup-nodestep log, confirm the npm cache is saved/restored (first run saves, re-run of the job restores).grep -n "^n " *.shshowsn $(cat .nvmrc)in all four deploy scripts; running one locally (e.g. the anvil-catalog dev deploy up to thenpm ciline) switches to Node 22.13.0 with no EBADENGINE warning.🤖 Generated with Claude Code