name: CI on: pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ci-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: test: name: test (${{ matrix.node-version }}) runs-on: ubuntu-latest timeout-minutes: 30 env: NPM_CONFIG_USERCONFIG: /dev/null PM_TEST_DEPTH: quick strategy: fail-fast: false matrix: node-version: [22, 26] steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: fetch-depth: 0 fetch-tags: true persist-credentials: false # Checkout must precede this first decision. NUL delimiters handle unusual # filenames; compare the actual PR endpoints, not the synthetic merge commit. # Disable rename folding so moving source into docs still counts its deletion. - name: Detect code changes id: changes shell: bash env: BASE_SHA: ${{ github.event.pull_request.base.sha }} HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | set -euo pipefail code=true if [[ "$GITHUB_EVENT_NAME" == pull_request ]]; then code=false git diff --name-only --no-renames -z "$BASE_SHA...$HEAD_SHA" > "$RUNNER_TEMP/ci-changed-paths" while IFS= read -r -d '' path; do case "$path" in .agents/pm/*.mjs|.agents/pm/*.cjs|.agents/pm/*.js|.agents/pm/*.ts) code=true ;; .agents/pm/*.toon|.agents/pm/*.json|.agents/pm/*.jsonl|*.md|docs/*|CHANGELOG.md|LICENSE) ;; *) code=true ;; esac done < "$RUNNER_TEMP/ci-changed-paths" fi echo "code=$code" >> "$GITHUB_OUTPUT" - name: Setup Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 with: node-version: ${{ matrix.node-version }} cache: npm - name: Setup Bun if: steps.changes.outputs.code == 'true' && matrix.node-version == 26 uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 - name: Install dependencies run: npm ci - name: Verify tracked pm project health run: ./node_modules/.bin/pm health --strict-exit --require-merge-drivers - name: Check documentation and tracker changes if: steps.changes.outputs.code != 'true' run: | npm run identity:check npm run changelog:check npm run build npm run pack:dry-run npm run verify:release-publish-attestation node --test test/tooling.test.ts - name: Engines floor build and quick tests if: steps.changes.outputs.code == 'true' && matrix.node-version == 22 run: npm test - name: Quick npm release gate if: steps.changes.outputs.code == 'true' && matrix.node-version == 26 run: npm run release:check # test:install already installs the packed archive with npm and Bun and # executes the installed host with npx and bunx --bun --no-install. - name: Bun package graph smoke if: steps.changes.outputs.code == 'true' && matrix.node-version == 26 run: bun install --no-save