|
5 | 5 | branches: [main] |
6 | 6 | pull_request: |
7 | 7 |
|
| 8 | +# Cancel in-flight runs for the same workflow + ref. Including |
| 9 | +# `github.workflow` in the key keeps this from colliding with any other |
| 10 | +# workflow that happens to share a ref-based group prefix. |
8 | 11 | concurrency: |
9 | | - group: ci-${{ github.ref }} |
| 12 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
10 | 13 | cancel-in-progress: true |
11 | 14 |
|
12 | 15 | # Least-privilege: this workflow only reads the repo to lint/build/verify; it |
|
34 | 37 | with: |
35 | 38 | node-version-file: .nvmrc |
36 | 39 |
|
| 40 | + # Cache Bun's resolved package store keyed on the lockfile hash. Cuts |
| 41 | + # ~10s off `bun install` on a clean runner; the restore-key falls back |
| 42 | + # to any prior cache from this OS so partial hits still help. |
| 43 | + - name: Cache Bun install cache |
| 44 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 45 | + with: |
| 46 | + path: ~/.bun/install/cache |
| 47 | + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} |
| 48 | + restore-keys: | |
| 49 | + ${{ runner.os }}-bun- |
| 50 | +
|
| 51 | + # Cache Next.js's incremental build output. Keyed on lockfile + commit |
| 52 | + # SHA so the exact-key match is always per-commit fresh; restore-keys |
| 53 | + # fall back to any previous build on the same lockfile, then any build |
| 54 | + # on this OS — so most CI runs hit a cache and skip rebuilding |
| 55 | + # unchanged webpack modules. |
| 56 | + - name: Cache Next.js build cache |
| 57 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 58 | + with: |
| 59 | + path: ${{ github.workspace }}/.next/cache |
| 60 | + key: ${{ runner.os }}-nextjs-${{ hashFiles('bun.lock') }}-${{ github.sha }} |
| 61 | + restore-keys: | |
| 62 | + ${{ runner.os }}-nextjs-${{ hashFiles('bun.lock') }}- |
| 63 | + ${{ runner.os }}-nextjs- |
| 64 | +
|
37 | 65 | - name: Install |
38 | 66 | run: bun install --frozen-lockfile |
39 | 67 |
|
|
0 commit comments