name: CI # One Linux job per pull request (owner rule: Actions minutes are shared with other # repos). Windows and the newest Node run nightly instead (nightly.yml). on: pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ci-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: check: name: check runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # A docs-only change still reports this check (so it can stay required), # but skips installing and testing. - name: What changed id: changes if: github.event_name == 'pull_request' env: BASE: ${{ github.event.pull_request.base.sha }} run: | if git diff --name-only "$BASE" HEAD | grep -qvE '\.md$|^assets/|^\.github/ISSUE_TEMPLATE/|^LICENSE$'; then echo "code=true" >> "$GITHUB_OUTPUT" else echo "code=false" >> "$GITHUB_OUTPUT" echo "Only docs changed; skipping install and tests." fi - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 if: steps.changes.outputs.code != 'false' with: node-version: 22 cache: npm - if: steps.changes.outputs.code != 'false' run: npm ci - if: steps.changes.outputs.code != 'false' run: npm run typecheck - if: steps.changes.outputs.code != 'false' run: npm test - if: steps.changes.outputs.code != 'false' run: npm run build && node dist/cli.js --version