fix(loops): recover when review card is missing (#3752) #17
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: Warm caches | |
| # GitHub only shares caches saved on main with other branches, and the PR | |
| # workflows never run on main. This job seeds the caches they restore. | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: warm-caches-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| # No restore-keys: a fresh save per commit keeps the cache from growing | |
| # forever, at the cost of a cold build on every main push. | |
| - name: Cache turbo artifacts | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: .turbo/cache | |
| key: turbo-${{ github.sha }} | |
| # Same key as code-storybook.yml's storybook job. | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-chromium-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| SKIP_ELECTRON_REBUILD: "1" | |
| - name: Seed turbo cache (build + typecheck) | |
| run: | | |
| pnpm run build:deps | |
| pnpm run typecheck | |
| - name: Install Playwright Chromium | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| working-directory: apps/code | |
| run: pnpm exec playwright install chromium | |
| macos: | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| id: node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| # Same keys as test.yml's integration-test job. | |
| - name: Cache Electron binary | |
| id: electron-cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/Library/Caches/electron | |
| key: electron-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/Library/Caches/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| # macOS minutes are 10x; do nothing when every cache is already warm. | |
| - name: Install dependencies | |
| if: >- | |
| steps.node.outputs.cache-hit != 'true' || | |
| steps.electron-cache.outputs.cache-hit != 'true' || | |
| steps.playwright-cache.outputs.cache-hit != 'true' | |
| # Electron's own postinstall fills ~/Library/Caches/electron; the sqlite | |
| # rebuild only touches node_modules, which is not cached, so skip it. | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| SKIP_ELECTRON_REBUILD: "1" | |
| - name: Install Playwright Chromium | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: pnpm --filter code exec playwright install chromium |