|
13 | 13 | default: false |
14 | 14 | type: boolean |
15 | 15 |
|
| 16 | +concurrency: |
| 17 | + group: wf-${{github.event.pull_request.number || github.ref || github.sha}}-${{github.workflow}} |
| 18 | + cancel-in-progress: true |
| 19 | + |
16 | 20 | env: |
17 | 21 | NX_SKIP_NX_CACHE: ${{ contains(github.event.pull_request.labels.*.name, 'skip-cache') && 'true' || 'false' }} |
18 | 22 |
|
|
24 | 28 | - name: Get sources |
25 | 29 | uses: actions/checkout@v6 |
26 | 30 |
|
| 31 | + - name: Pin Nx machine id |
| 32 | + uses: ./.github/actions/pin-nx-machine-id |
| 33 | + |
27 | 34 | - name: Use Node.js |
28 | 35 | uses: actions/setup-node@v6 |
29 | 36 | with: |
|
46 | 53 | restore-keys: | |
47 | 54 | ${{ runner.os }}-pnpm-cache |
48 | 55 |
|
| 56 | + - name: Lookup nx cache |
| 57 | + id: lookup-nx-cache |
| 58 | + uses: actions/cache/restore@v5 |
| 59 | + with: |
| 60 | + path: | |
| 61 | + .nx/cache |
| 62 | + .nx/workspace-data/*.db |
| 63 | + .nx/workspace-data/*.db-wal |
| 64 | + .nx/workspace-data/*.db-shm |
| 65 | + key: ${{ runner.os }}-nx-v2-${{ github.sha }}-${{ github.workflow }}-${{ github.job }}-${{ github.run_attempt }} |
| 66 | + restore-keys: | |
| 67 | + ${{ runner.os }}-nx-v2-${{ github.sha }}-${{ github.workflow }}-${{ github.job }}- |
| 68 | + ${{ runner.os }}-nx-v2-${{ github.sha }}- |
| 69 | + ${{ runner.os }}-nx-v2- |
| 70 | +
|
| 71 | + lookup-only: true |
| 72 | + |
| 73 | + - name: Show nx cache status |
| 74 | + shell: bash |
| 75 | + run: | |
| 76 | + echo "Nx cache lookup exact hit: ${{ steps.lookup-nx-cache.outputs.cache-hit }}" |
| 77 | + echo "Nx cache primary key: ${{ steps.lookup-nx-cache.outputs.cache-primary-key }}" |
| 78 | + echo "Nx cache matched key: ${{ steps.lookup-nx-cache.outputs.cache-matched-key }}" |
| 79 | + if [ -z "${{ steps.lookup-nx-cache.outputs.cache-matched-key }}" ]; then |
| 80 | + echo "Nx cache lookup: miss" |
| 81 | + elif [ "${{ steps.lookup-nx-cache.outputs.cache-hit }}" = "true" ]; then |
| 82 | + echo "Nx cache lookup: exact hit" |
| 83 | + else |
| 84 | + echo "Nx cache lookup: partial hit via restore-keys" |
| 85 | + fi |
| 86 | +
|
49 | 87 | - name: Install dependencies |
50 | 88 | run: pnpm install --frozen-lockfile |
51 | 89 |
|
| 90 | + - name: Setup nx cache |
| 91 | + id: setup-nx-cache |
| 92 | + uses: actions/cache@v5 |
| 93 | + with: |
| 94 | + path: | |
| 95 | + .nx/cache |
| 96 | + .nx/workspace-data/*.db |
| 97 | + .nx/workspace-data/*.db-wal |
| 98 | + .nx/workspace-data/*.db-shm |
| 99 | + key: ${{ runner.os }}-nx-v2-${{ github.sha }}-${{ github.workflow }}-${{ github.job }}-${{ github.run_attempt }} |
| 100 | + restore-keys: | |
| 101 | + ${{ runner.os }}-nx-v2-${{ github.sha }}-${{ github.workflow }}-${{ github.job }}- |
| 102 | + ${{ runner.os }}-nx-v2-${{ github.sha }}- |
| 103 | + ${{ runner.os }}-nx-v2- |
| 104 | +
|
52 | 105 | - name: Build npm packages |
53 | 106 | run: pnpm run all:build |
54 | 107 |
|
|
0 commit comments