Skip to content

ci: Pin to Node 22 and tidy the workflows - #250

Merged
RobinBol merged 4 commits into
masterfrom
chore/workflow-hygiene
Oct 23, 2026
Merged

RobinBol merged 4 commits into
masterfrom
chore/workflow-hygiene

Conversation

@RobinBol

@RobinBol RobinBol commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What

Workflow upkeep, stacked on #247. Four commits:

  1. ci: pin development and CI to Node 22 - .nvmrc 24 -> 22
  2. ci: gate the testing branch, cache npm, update the actions
  3. ci: keep publishing working on Node 22 and gate it on the checks
  4. ci: validate before building the docs in the deploy job

Why

The supported floor was never tested. engines.node says >=22, but .nvmrc said 24 and all five workflows read it, so nothing ever ran on the version the package claims to support. engines stays >=22; this only changes what the project itself develops and tests against.

Pushes to testing ran neither Lint nor Test, while deploy.yml publishes a beta from that branch. Both now trigger on it. Triggers alone hold nothing back, though, so commit 3 runs lint, format:check and test inside the deploy job, before the version bump, where a failure stops the publish rather than racing it.

Pinning to 22 would have broken publishing. Publishing uses OIDC with --provenance and carries no NPM_AUTH_TOKEN, which needs npm >= 11.5.1. Node 22 bundles npm 10.9.9, and setup-node installs whatever npm ships with the Node it picks, so both publishes would have failed authentication after the version bump and tags were pushed. Commit 3 upgrades npm explicitly; npm 11.21.1 needs Node ^20.17.0 || >=22.9.0 and 22 resolves to 22.23.4.

Also: four of five workflows had no cache: 'npm', the actions were three majors behind (checkout and setup-node v4 -> v7, actions-gh-pages v3.8.0 -> v4), and a comment in deploy.yml still described a Node 12 environment.

Testing

full run on Node 22.23.4 at the tip of this stack
node -v                       v22.23.4
npm -v                        10.9.9
npm ci                        added 248 packages
npm test                      pass 114, fail 0
npm run lint                  exit 0
npm run format:check          clean
npm run build                 ok
npm run generate-types        index.d.ts unchanged
npx tsc --noEmit index.d.ts   exit 0

This covers the native type stripping #243 relies on, which needs Node 22.18 or newer.

Anything else

Stacked on chore/node-test rather than cut from the default branch: #245 reformats four of these five files, so a parallel PR would conflict on every one.

actions-gh-pages@v4 is the one bump no run here exercises, since docs.yml only triggers on a release push.

Left out on purpose: deploy.yml runs npm run build before publishing and none of its output is packed, but the build doubles as a check that the docs still build before a release.

@RobinBol RobinBol self-assigned this Oct 23, 2026
@RobinBol
RobinBol requested a balanced review from Copilot October 23, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Deployment needs an npm version that supports trusted publishing, and beta publishing still does not wait for successful validation.

2 open issues
What changed in this PR

This PR aligns development and CI with Node 22, the package’s supported major-version floor, and updates the workflows on top of the test-runner migration.

Changes:

  • Switch .nvmrc from Node 24 to Node 22.
  • Add Test and Lint runs for pushes to testing.
  • Update action versions, enable npm caching in four workflows, and correct the deployment comment.
File Description
.nvmrc Select Node 22 for development and CI.
.github/​workflows/​test.yml Test testing pushes; update actions and enable npm caching.
.github/​workflows/​lint.yml Lint testing pushes; update actions and enable npm caching.
.github/​workflows/​generate-types.yml Update checkout and Node setup actions.
.github/​workflows/​docs.yml Update build/deployment actions and enable npm caching.
.github/​workflows/​deploy.yml Update actions, enable npm caching, and correct the Node-version comment.

Review effort: Balanced

Comment thread .github/workflows/deploy.yml
Comment thread .github/workflows/test.yml
@RobinBol
RobinBol requested a balanced review from Copilot October 23, 2026 06:37
@RobinBol
RobinBol marked this pull request as ready for review October 23, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both previously reported release issues are resolved, and no blocking findings remain.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both previously reported blockers are resolved, and no unresolved issues were identified in these focused workflow changes.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both previously reported deployment issues are resolved, and no remaining blocking issues were identified.

No open issues 🎉

Review effort: Balanced

The repository supports Node 22 and up, but every workflow ran Node 24
through .nvmrc, so the supported floor was never the version anything
was actually checked against.

Verified on Node 22.23.4, the current 22.x, at the tip of the open
stack: npm ci, 114 tests pass, lint, format:check, the docs build,
generate-types with an unchanged index.d.ts, and tsc all succeed. That
includes the native type stripping #243 relies on, which needs Node
22.18 or newer; `22` in .nvmrc resolves to the latest 22.x.

engines.node stays ">=22": consumers are not restricted to 22, this only
fixes what the project itself develops and tests against.
Four unrelated bits of workflow upkeep.

Pushes to `testing` ran neither Lint nor Test, while deploy.yml
publishes a beta from that same branch. Both workflows now trigger on it.

setup-node gets `cache: 'npm'` in the four workflows that lacked it;
generate-types.yml already had it. They each re-resolved the whole tree
on every run.

actions/checkout and actions/setup-node go from v4 to v7, and
peaceiris/actions-gh-pages from v3.8.0 to v4.

The deploy.yml header still described a Node 12 environment; it has read
the version from .nvmrc for a long time.
Two problems the Node 22 pin exposed in deploy.yml.

Publishing uses OIDC trusted publishing with --provenance and carries no
NPM_AUTH_TOKEN, and that needs npm 11.5.1 or newer. Node 22 bundles npm
10.9.9, and setup-node installs whatever npm ships with the Node version
it selects, so both the production and the beta publish would have failed
authentication, after the version bump and tags had already been pushed.
npm is now upgraded explicitly. npm 11 needs Node >=22.9.0 and `22` in
.nvmrc resolves well past that.

Adding `testing` to the Lint and Test workflows made the checks run on
that branch but did not hold anything back: deploy.yml starts on the same
push and neither waits for them nor repeats them, so a `#patch` push
could still publish a beta before they finished. The deploy job now runs
lint, format:check and the tests itself, before the version bump, so a
failure stops the publish instead of racing it.
The docs build is the slowest step in the job and nothing about
publishing depends on it, so running lint, format:check and the tests
first means a failing check stops the job before that minute is spent.
Build and the publish steps that follow are unchanged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both previously identified deployment blockers are resolved, and no unresolved blocking issues remain.

No open issues 🎉

Review effort: Balanced

Base automatically changed from chore/node-test to master October 23, 2026 08:08
@RobinBol
RobinBol merged commit bd01c5b into master Oct 23, 2026
3 checks passed
@RobinBol
RobinBol deleted the chore/workflow-hygiene branch October 23, 2026 08:09
@RobinBol RobinBol added the internal Tooling, CI or docs, left out of the release notes label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Tooling, CI or docs, left out of the release notes

Development

Successfully merging this pull request may close these issues.

2 participants