feat: Agnostic Pipeline Kinds & Internal Runner Refactor #704
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Cancel in-progress runs for the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Environment variables for caching | |
| env: | |
| NODE_VERSION: '22.20.0' | |
| PNPM_VERSION: '10.19.0' | |
| jobs: | |
| # Setup: Install dependencies once and cache for all jobs | |
| setup: | |
| name: Setup & Install Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Cache node_modules | |
| id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| node-modules-${{ runner.os }}- | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: pnpm install --frozen-lockfile | |
| # Lint: Check code quality | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| needs: [setup, build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| fail-on-cache-miss: false | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| packages/*/*.tsbuildinfo | |
| examples/*/build | |
| examples/*/dist | |
| packages/php-json-ast/vendor | |
| packages/cli/vendor | |
| key: build-${{ runner.os }}-${{ github.run_id }} | |
| fail-on-cache-miss: true | |
| - name: Check emitted d.ts imports | |
| run: pnpm lint:dts-imports | |
| - name: Typecheck test-utils drift | |
| run: pnpm typecheck:test-utils | |
| - name: Run ESLint | |
| run: pnpm lint | |
| - name: Check Prettier formatting | |
| run: pnpm format:check | |
| - name: TypeScript type check | |
| run: pnpm typecheck | |
| - name: Check dist declarations for source imports | |
| run: node scripts/check-dts-imports.mjs | |
| # Build: Ensure all packages build successfully | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| # Moved PHP setup here so build artefacts reflect the PHP toolchain | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| tools: composer | |
| coverage: none | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| fail-on-cache-miss: false | |
| # Per-run build cache (symlink-safe transport within this CI run) | |
| - name: Cache build outputs | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| packages/*/*.tsbuildinfo | |
| examples/*/build | |
| examples/*/dist | |
| packages/php-json-ast/vendor | |
| packages/cli/vendor | |
| key: build-${{ runner.os }}-${{ github.run_id }} | |
| # Always build – key is unique per run, so this is always the first writer | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Upload build artifacts (fallback) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: | | |
| packages/*/dist | |
| examples/*/build | |
| retention-days: 1 | |
| # Unit Tests: Run Jest tests | |
| unit-test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: [setup, build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| tools: composer | |
| coverage: none | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| fail-on-cache-miss: false | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| packages/*/*.tsbuildinfo | |
| examples/*/build | |
| examples/*/dist | |
| packages/php-json-ast/vendor | |
| packages/cli/vendor | |
| key: build-${{ runner.os }}-${{ github.run_id }} | |
| fail-on-cache-miss: true | |
| - name: Run unit tests with coverage | |
| run: pnpm test:coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: unit-tests | |
| fail_ci_if_error: false | |
| release-pack: | |
| name: Release Pack Readiness | |
| runs-on: ubuntu-latest | |
| needs: [setup, build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| fail-on-cache-miss: false | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| packages/*/*.tsbuildinfo | |
| examples/*/build | |
| examples/*/dist | |
| packages/php-json-ast/vendor | |
| packages/cli/vendor | |
| key: build-${{ runner.os }}-${{ github.run_id }} | |
| fail-on-cache-miss: true | |
| - name: Verify release pack readiness idempotency | |
| run: pnpm --filter @wpkernel/cli exec tsx scripts/check-release-pack-ci.ts | |
| bootstrapper: | |
| name: Bootstrapper Resolution | |
| runs-on: ubuntu-latest | |
| needs: [setup, build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| fail-on-cache-miss: false | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| packages/*/*.tsbuildinfo | |
| examples/*/build | |
| examples/*/dist | |
| packages/php-json-ast/vendor | |
| packages/cli/vendor | |
| key: build-${{ runner.os }}-${{ github.run_id }} | |
| fail-on-cache-miss: true | |
| - name: Verify bootstrapper resolution | |
| run: pnpm --filter @wpkernel/cli exec tsx scripts/check-bootstrapper-resolution-ci.ts | |
| smoke: | |
| name: Smoke Create/Generate/Apply | |
| runs-on: ubuntu-latest | |
| needs: [setup, build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| tools: composer | |
| coverage: none | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| packages/*/node_modules | |
| examples/*/node_modules | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| fail-on-cache-miss: false | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| packages/*/*.tsbuildinfo | |
| examples/*/build | |
| examples/*/dist | |
| packages/php-json-ast/vendor | |
| packages/cli/vendor | |
| key: build-${{ runner.os }}-${{ github.run_id }} | |
| fail-on-cache-miss: true | |
| - name: Run smoke test | |
| run: node scripts/test/smoke-create-generate.mjs --package-managers=pnpm --keep-artifacts | |
| - name: Upload smoke artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smoke-cli-artifacts | |
| path: artifacts/cli-smoke | |
| if-no-files-found: warn | |
| - name: Clean smoke artifacts | |
| if: always() | |
| run: rm -rf artifacts/cli-smoke | |
| # E2E Tests (disabled) | |
| # e2e-test: | |
| # ... | |
| # All checks passed | |
| all-checks: | |
| name: All Checks Passed | |
| runs-on: ubuntu-latest | |
| needs: [lint, build, unit-test, release-pack, bootstrapper, smoke] | |
| if: always() | |
| steps: | |
| - name: Check status | |
| run: | | |
| if [[ "${{ needs.lint.result }}" != "success" ]] || \ | |
| [[ "${{ needs.build.result }}" != "success" ]] || \ | |
| [[ "${{ needs.unit-test.result }}" != "success" ]] || \ | |
| [[ "${{ needs.release-pack.result }}" != "success" ]] || \ | |
| [[ "${{ needs.bootstrapper.result }}" != "success" ]] || \ | |
| [[ "${{ needs.smoke.result }}" != "success" ]]; then | |
| echo "❌ One or more checks failed" | |
| exit 1 | |
| fi | |
| echo "✅ All checks passed!" |