From 758e6659b2bbcbda1250e86cd58e4a8cdd78893a Mon Sep 17 00:00:00 2001 From: CodeSigils Date: Sun, 6 Sep 2026 10:45:10 +0300 Subject: [PATCH 1/2] ci: test supported runtimes and packed package --- .github/workflows/ci.yml | 8 +++++++- README.md | 9 +++++---- scripts/validators/ci.js | 4 ++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f268b5f..5890cce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,12 @@ jobs: - run: npm run check:links - name: Build tested npm package run: mkdir -p artifacts && npm pack --pack-destination artifacts + - name: Smoke-test the packed npm package + run: | + package_dir="$(mktemp -d)" + npm install --prefix "$package_dir" --no-save "./artifacts/"*.tgz + "$package_dir/node_modules/.bin/mdfmt" --version + "$package_dir/node_modules/.bin/mdfmt" --check README.md - name: Upload tested npm package uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: @@ -55,7 +61,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ['24.x', '25.x'] + node-version: ['22.x', '24.x'] env: CHECK_BASE_REF: origin/main GH_TOKEN: ${{ github.token }} diff --git a/README.md b/README.md index dba017f..197c18d 100644 --- a/README.md +++ b/README.md @@ -447,11 +447,12 @@ runtime or formatting behavior changes. ### CI and pull requests Every pull request must pass the deterministic `lint` gate and both runtime -matrix jobs (`test (24.x)` and `test (25.x)`). The lint gate runs formatting, +matrix jobs (`test (22.x)` and `test (24.x)`). The lint gate runs formatting, payload synchronization, dependency audit, offline link checks, and builds the -single npm tarball used by publishing; the runtime jobs focus on the test suite -across supported Node versions. Publishing is allowed only after all three -gates succeed. +single npm tarball used by publishing. It also installs that tarball into a +clean temporary prefix and exercises the packaged `mdfmt` binary; the runtime +jobs focus on the test suite across supported Node versions. Publishing is +allowed only after all three gates succeed. Live HTTP checks are intentionally not required for pull requests. The `external-contracts` job runs weekly and on demand from the Actions tab, so an diff --git a/scripts/validators/ci.js b/scripts/validators/ci.js index 85e1761..3419abe 100644 --- a/scripts/validators/ci.js +++ b/scripts/validators/ci.js @@ -40,6 +40,7 @@ function validateCi(files) { { pattern: /actions\/upload-artifact@/i, label: "uploads the tested npm package" }, { pattern: /actions\/download-artifact@/i, label: "publishes the tested npm package artifact" }, { pattern: /npm\s+publish\s+(?:\.\/)?artifacts\/\*\.tgz/i, label: "publishes the tested npm tarball" }, + { pattern: /Smoke-test the packed npm package/i, label: "smoke-tests the packed npm package" }, { pattern: /npm\s+ci/i, label: "installs repository dependencies" }, { pattern: /CHECK_BASE_REF/i, label: "sets CHECK_BASE_REF for release-drift checks" }, { pattern: /fetch-depth:\s*0/i, label: "uses full git depth for diff history in precheck" }, @@ -58,6 +59,9 @@ function validateCi(files) { if (!/needs:\s*\[\s*test\s*,\s*lint\s*\]/i.test(ci)) { warnings.push("ci.yml: publish should require both test and lint jobs"); } + if (!/node-version:\s*\['22\.x',\s*'24\.x'\]/i.test(ci)) { + warnings.push("ci.yml: test matrix should cover supported Node 22.x and 24.x runtimes"); + } // .node-version alignment const nodeVersionContent = read(".node-version"); From 671493b7ee65e6a685a7659474181ff6afa5f67a Mon Sep 17 00:00:00 2001 From: CodeSigils Date: Sun, 6 Sep 2026 10:46:12 +0300 Subject: [PATCH 2/2] ci: align runtime matrix with package engines --- .github/workflows/ci.yml | 2 +- README.md | 2 +- scripts/validators/ci.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5890cce..1f708d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ['22.x', '24.x'] + node-version: ['24.x', '26.x'] env: CHECK_BASE_REF: origin/main GH_TOKEN: ${{ github.token }} diff --git a/README.md b/README.md index 197c18d..71ae119 100644 --- a/README.md +++ b/README.md @@ -447,7 +447,7 @@ runtime or formatting behavior changes. ### CI and pull requests Every pull request must pass the deterministic `lint` gate and both runtime -matrix jobs (`test (22.x)` and `test (24.x)`). The lint gate runs formatting, +matrix jobs (`test (24.x)` and `test (26.x)`). The lint gate runs formatting, payload synchronization, dependency audit, offline link checks, and builds the single npm tarball used by publishing. It also installs that tarball into a clean temporary prefix and exercises the packaged `mdfmt` binary; the runtime diff --git a/scripts/validators/ci.js b/scripts/validators/ci.js index 3419abe..f0e1d6a 100644 --- a/scripts/validators/ci.js +++ b/scripts/validators/ci.js @@ -59,8 +59,8 @@ function validateCi(files) { if (!/needs:\s*\[\s*test\s*,\s*lint\s*\]/i.test(ci)) { warnings.push("ci.yml: publish should require both test and lint jobs"); } - if (!/node-version:\s*\['22\.x',\s*'24\.x'\]/i.test(ci)) { - warnings.push("ci.yml: test matrix should cover supported Node 22.x and 24.x runtimes"); + if (!/node-version:\s*\['24\.x',\s*'26\.x'\]/i.test(ci)) { + warnings.push("ci.yml: test matrix should cover the declared Node >=24 floor and current 26.x runtime"); } // .node-version alignment