name: Code Quality on: push: branches: [main] paths: - "packages/**" - "api-surface/**" - "apps/**" - "examples/**" - "templates/**" - "scripts/generate-api-surface.mjs" - "scripts/check-api-surface.mjs" - "scripts/lib/script-options.mjs" - "scripts/sync-templates.sh" - "turbo.json" - "package.json" - "pnpm-lock.yaml" - ".github/workflows/code-quality.yaml" pull_request: branches: [main] paths: - "packages/**" - "api-surface/**" - "apps/**" - "examples/**" - "templates/**" - "scripts/generate-api-surface.mjs" - "scripts/check-api-surface.mjs" - "scripts/lib/script-options.mjs" - "scripts/sync-templates.sh" - "turbo.json" - "package.json" - "pnpm-lock.yaml" - ".github/workflows/code-quality.yaml" permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: lint: name: Oxlint + Oxfmt runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 5 steps: - name: Checkout code repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # ratchet:actions/checkout@v7 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # ratchet:pnpm/action-setup@v6.0.9 - name: Setup node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6 with: node-version: 24 cache: "pnpm" - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run oxlint + oxfmt run: pnpm lint - name: Check resource memoization (React Compiler) run: pnpm check:resource-memo template-sync: name: Template Sync runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 2 steps: - name: Checkout code repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # ratchet:actions/checkout@v7 with: fetch-depth: 1 - name: Verify templates match packages/ui source run: bash scripts/sync-templates.sh build: name: Build Changed Packages runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 10 steps: - name: Checkout code repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # ratchet:actions/checkout@v7 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # ratchet:pnpm/action-setup@v6.0.9 - name: Setup node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6 with: node-version: 24 cache: "pnpm" - name: Cache turbo build setup uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # ratchet:actions/cache@v5 with: path: .turbo key: ${{ runner.os }}-turbo-build-${{ github.ref }}-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo-build-${{ github.ref }}- ${{ runner.os }}-turbo-build- ${{ runner.os }}-turbo- - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build packages run: | if [ "${{ github.event_name }}" = "pull_request" ]; then # PR: Build packages changed compared to base branch pnpm turbo build --filter="...[origin/${{ github.base_ref }}]" else # Push to main: Build packages changed in last commit pnpm turbo build --filter="...[HEAD^1]" fi - name: Check API surface run: | if [ "${{ github.event_name }}" = "pull_request" ]; then # PR: Check API surface for packages changed compared to base branch pnpm run api-surface:check -- --skip-build --filter="...[origin/${{ github.base_ref }}]" else # Push to main: Check API surface for packages changed in last commit pnpm run api-surface:check -- --skip-build --filter="...[HEAD^1]" fi - name: Test API surface generator run: pnpm run api-surface:test test: name: Test Changed Packages runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 5 # Note: No dependency on 'build' job - Turbo handles test->build dependencies internally via dependsOn steps: - name: Checkout code repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # ratchet:actions/checkout@v7 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # ratchet:pnpm/action-setup@v6.0.9 - name: Setup node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6 with: node-version: 24 cache: "pnpm" - name: Cache turbo build setup uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # ratchet:actions/cache@v5 with: path: .turbo key: ${{ runner.os }}-turbo-test-${{ github.ref }}-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo-test-${{ github.ref }}- ${{ runner.os }}-turbo-test- ${{ runner.os }}-turbo- - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run tests run: | if [ "${{ github.event_name }}" = "pull_request" ]; then # PR: Test packages changed compared to base branch pnpm turbo test --filter="...[origin/${{ github.base_ref }}]" else # Push to main: Test packages changed in last commit pnpm turbo test --filter="...[HEAD^1]" fi