ci: bump actions/checkout from 4 to 7 #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ────────────────────────────────────────────────────────────────────────────── | |
| # CI — Primary quality gate for all pushes and pull requests | |
| # | |
| # Runs on every push to main/develop and every PR targeting them. | |
| # Matrix: Node 20.x and 22.x on Ubuntu. | |
| # | |
| # Steps: install → typecheck → unit tests (with coverage) → build → e2e tests | |
| # ────────────────────────────────────────────────────────────────────────────── | |
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_call: # Allow reuse from release workflow | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ── Typecheck ──────────────────────────────────────────────────────────── | |
| typecheck: | |
| name: Typecheck (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ['20.x', '22.x'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| # ── Unit Tests ─────────────────────────────────────────────────────────── | |
| unit-tests: | |
| name: Unit Tests (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| needs: typecheck | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ['20.x', '22.x'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests with coverage | |
| run: npm run test:coverage | |
| - name: Upload coverage artifact | |
| if: matrix.node-version == '22.x' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 14 | |
| # ── Build ──────────────────────────────────────────────────────────────── | |
| build: | |
| name: Build (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| needs: typecheck | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ['20.x', '22.x'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Verify build artifacts exist | |
| run: | | |
| test -f out/dist/index.js || (echo "Missing: out/dist/index.js" && exit 1) | |
| test -f out/dist/cli/server.js || (echo "Missing: out/dist/cli/server.js" && exit 1) | |
| test -f out/tsc/index.d.ts || (echo "Missing: out/tsc/index.d.ts" && exit 1) | |
| echo "All build artifacts verified." | |
| - name: Verify CLI binary has shebang | |
| run: head -1 out/dist/cli/server.js | grep -q '#!/usr/bin/env node' | |
| - name: Upload build artifacts | |
| if: matrix.node-version == '22.x' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-output | |
| path: | | |
| out/dist/ | |
| out/tsc/ | |
| retention-days: 7 | |
| # ── E2E Tests ──────────────────────────────────────────────────────────── | |
| e2e-tests: | |
| name: E2E Tests (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ['20.x', '22.x'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build (required for e2e) | |
| run: npm run build | |
| - name: Run E2E tests | |
| run: npm run test:e2e | |
| # ── Package Dry Run ───────────────────────────────────────────────────── | |
| package-check: | |
| name: Package Dry Run | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js 22.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Pack dry run | |
| run: npm pack --dry-run 2>&1 | tee pack-output.txt | |
| - name: Verify package contents | |
| run: | | |
| # Ensure critical files are included in the package | |
| grep -q 'out/dist/index.js' pack-output.txt || (echo "Missing: out/dist/index.js in package" && exit 1) | |
| grep -q 'out/dist/cli/server.js' pack-output.txt || (echo "Missing: out/dist/cli/server.js in package" && exit 1) | |
| grep -q 'out/tsc/index.d.ts' pack-output.txt || (echo "Missing: out/tsc/index.d.ts in package" && exit 1) | |
| grep -q 'README.md' pack-output.txt || (echo "Missing: README.md in package" && exit 1) | |
| grep -q 'LICENSE' pack-output.txt || (echo "Missing: LICENSE in package" && exit 1) | |
| grep -q 'POWER.md' pack-output.txt || (echo "Missing: POWER.md in package" && exit 1) | |
| echo "Package contents verified." |