From 796d1b32c2ee2b98549839c6f4d402fe64e320c5 Mon Sep 17 00:00:00 2001 From: Mark Lavercombe Date: Tue, 28 Jul 2026 08:35:20 +1000 Subject: [PATCH] ci: add typecheck/test/build workflow on Node 20 and 24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This repo had no CI at all while its MCP sibling had three workflows, and the gap was not theoretical: 0.5.2 shipped with `agent-ready --version` printing 0.5.1, because nothing tied src/cli.ts VERSION to package.json. A wrong version misdirects every bug report, and it reached npm because publishing is fully manual here with no gate in front of it. Mirrors agent-ready-mcp's ci.yml, with a Node matrix instead of a single version. package.json declares engines >=20.10 while the main repo pins 24.x, and this is a published CLI run on whatever Node the user happens to have — so both ends need to stay green. Testing one end would hide breakage at the other. Build is included because `files` ships dist/cli.mjs and prepublishOnly rebuilds it: a build that only fails from a clean checkout would otherwise surface during `npm publish`, after the version is already chosen and immutable. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3fb70cf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # 20 is the floor package.json declares (engines >=20.10); 24 is what + # the main agent-ready repo pins (engines 24.x). A published CLI runs + # on whatever Node the user has, so both ends need to stay green — + # testing only one hides breakage at the other. + node-version: ["20", "24"] + name: test (node ${{ matrix.node-version }}) + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + - run: npm ci + + - name: Type check + run: npm run typecheck + + - name: Unit tests + run: npm test + + # `files` in package.json ships dist/cli.mjs, and prepublishOnly rebuilds + # it — so a build that only fails on a clean checkout would surface at + # `npm publish` time, after the version is already chosen. + - name: Build (verify dist/cli.mjs builds) + run: npm run build