diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c31c3d9b48..95d8396328 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,6 +86,12 @@ jobs: name: Test (${{ matrix.os }}, ${{ matrix.node }}) runs-on: ${{ matrix.os }} + env: + # Persisted V8 compile cache (restored/saved by the "Cache Node compile + # cache" step). Set at job level so vitest workers and any forked child + # processes inherit NODE_COMPILE_CACHE. + NODE_COMPILE_CACHE: ${{ runner.temp }}/node-compile-cache + concurrency: group: test-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }}, ${{ matrix.node }}) cancel-in-progress: true @@ -181,6 +187,15 @@ jobs: with: node-version: ${{ matrix.node }} + - name: Cache Node compile cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ runner.temp }}/node-compile-cache + key: node-compile-cache-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-workspace.yaml', '**/package.json') }} + restore-keys: | + node-compile-cache-${{ runner.os }}-node${{ matrix.node }}- + node-compile-cache-${{ runner.os }}- + - name: Cache utoo package store uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: @@ -244,6 +259,12 @@ jobs: name: Test bin (${{ matrix.os }}, ${{ matrix.node }}) runs-on: ${{ matrix.os }} + env: + # Persisted V8 compile cache (restored/saved by the "Cache Node compile + # cache" step). Set at job level so vitest workers and any forked child + # processes inherit NODE_COMPILE_CACHE. + NODE_COMPILE_CACHE: ${{ runner.temp }}/node-compile-cache + concurrency: group: test-egg-bin-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }}, ${{ matrix.node }}) cancel-in-progress: true @@ -260,6 +281,15 @@ jobs: with: node-version: ${{ matrix.node }} + - name: Cache Node compile cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ runner.temp }}/node-compile-cache + key: node-compile-cache-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-workspace.yaml', '**/package.json') }} + restore-keys: | + node-compile-cache-${{ runner.os }}-node${{ matrix.node }}- + node-compile-cache-${{ runner.os }}- + - name: Cache utoo package store uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: @@ -310,6 +340,12 @@ jobs: name: Test scripts (${{ matrix.os }}, ${{ matrix.node }}) runs-on: ${{ matrix.os }} + env: + # Persisted V8 compile cache (restored/saved by the "Cache Node compile + # cache" step). Set at job level so vitest workers and any forked child + # processes inherit NODE_COMPILE_CACHE. + NODE_COMPILE_CACHE: ${{ runner.temp }}/node-compile-cache + concurrency: group: test-egg-scripts-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }}, ${{ matrix.node }}) cancel-in-progress: true @@ -326,6 +362,15 @@ jobs: with: node-version: ${{ matrix.node }} + - name: Cache Node compile cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ runner.temp }}/node-compile-cache + key: node-compile-cache-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-workspace.yaml', '**/package.json') }} + restore-keys: | + node-compile-cache-${{ runner.os }}-node${{ matrix.node }}- + node-compile-cache-${{ runner.os }}- + - name: Cache utoo package store uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: