From 13f150ea195705efb64e247800777c429004bbd5 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Mon, 20 Apr 2026 17:32:58 -0400 Subject: [PATCH 1/3] ci: shadow typecheck/unit/integration jobs on Blacksmith Gated behind repo variable BLACKSMITH_SHADOW_ENABLED so shadow runs can be toggled without a code change. Pairs ubuntu-latest with blacksmith-4vcpu-ubuntu-2404 and macos-latest with blacksmith-6vcpu-macos-latest. Shadow entries are continue-on-error so Blacksmith failures don't block PRs, cache keys are scoped to matrix.runner to avoid cross-runner cache poisoning, and the Playwright report only uploads from the macos-latest primary. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/test.yml | 24 +++++++++++++++++------- .github/workflows/typecheck.yml | 7 ++++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db5b51cbe..b30f3288f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,12 @@ concurrency: jobs: unit-test: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["ubuntu-latest","blacksmith-4vcpu-ubuntu-2404"]' || '["ubuntu-latest"]') }} + runs-on: ${{ matrix.runner }} + continue-on-error: ${{ matrix.runner != 'ubuntu-latest' }} permissions: contents: read steps: @@ -37,7 +42,12 @@ jobs: run: pnpm test integration-test: - runs-on: macos-latest + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["macos-latest","blacksmith-6vcpu-macos-latest"]' || '["macos-latest"]') }} + runs-on: ${{ matrix.runner }} + continue-on-error: ${{ matrix.runner != 'macos-latest' }} permissions: contents: read steps: @@ -60,17 +70,17 @@ jobs: id: playwright-cache with: path: ~/Library/Caches/ms-playwright - key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + key: playwright-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} restore-keys: | - playwright-${{ runner.os }}- + playwright-${{ matrix.runner }}- - name: Cache Electron binary uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: ~/Library/Caches/electron - key: electron-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + key: electron-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} restore-keys: | - electron-${{ runner.os }}- + electron-${{ matrix.runner }}- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -103,7 +113,7 @@ jobs: - name: Upload Playwright report uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 - if: failure() + if: failure() && matrix.runner == 'macos-latest' with: name: playwright-report path: apps/code/playwright-report/ diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 0701c6f39..766714bfb 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -9,7 +9,12 @@ concurrency: jobs: typecheck: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["ubuntu-latest","blacksmith-4vcpu-ubuntu-2404"]' || '["ubuntu-latest"]') }} + runs-on: ${{ matrix.runner }} + continue-on-error: ${{ matrix.runner != 'ubuntu-latest' }} permissions: contents: read steps: From 37d89804f27f6e5dd4d2fa4450ff15e6088dc064 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Tue, 21 Apr 2026 06:41:04 -0400 Subject: [PATCH 2/3] ci: scope pnpm store cache to matrix.runner actions/setup-node's built-in pnpm cache keys on runner.os, so ubuntu-latest and blacksmith-4vcpu-ubuntu-2404 (and the macOS pair) would share a cache entry and contaminate the shadow comparison. Replace with an explicit actions/cache keyed by matrix.runner, matching the Playwright/Electron cache pattern in test.yml. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++-- .github/workflows/typecheck.yml | 14 +++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b30f3288f..26beb9565 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,19 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - cache: "pnpm" + + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ matrix.runner }}- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -63,7 +75,19 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - cache: "pnpm" + + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ matrix.runner }}- - name: Cache Playwright browsers uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 766714bfb..0e13d92d7 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -30,7 +30,19 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - cache: "pnpm" + + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ matrix.runner }}- - name: Install dependencies run: pnpm install --frozen-lockfile From 760791c0f4eceb44ec7415911a788d05b32e63ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:09:57 +0000 Subject: [PATCH 3/3] ci: add explicit job names to preserve required check names Agent-Logs-Url: https://github.com/PostHog/code/sessions/2ea01766-809c-4b16-87dd-8efec52191c5 Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com> --- .github/workflows/test.yml | 2 ++ .github/workflows/typecheck.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26beb9565..1f4b3fba4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ concurrency: jobs: unit-test: + name: ${{ matrix.runner == 'ubuntu-latest' && 'unit-test' || format('unit-test ({0})', matrix.runner) }} strategy: fail-fast: false matrix: @@ -54,6 +55,7 @@ jobs: run: pnpm test integration-test: + name: ${{ matrix.runner == 'macos-latest' && 'integration-test' || format('integration-test ({0})', matrix.runner) }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 0e13d92d7..dbd26f4a9 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -9,6 +9,7 @@ concurrency: jobs: typecheck: + name: ${{ matrix.runner == 'ubuntu-latest' && 'typecheck' || format('typecheck ({0})', matrix.runner) }} strategy: fail-fast: false matrix: