diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b512153621d8..924feb42725e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -69,13 +69,14 @@ jobs: include: - runner: ubuntu-24.04 system: x86_64-linux + perfetto: true - runner: ubuntu-24.04-arm system: aarch64-linux - runner: macos-15-intel system: x86_64-darwin - runner: macos-latest system: aarch64-darwin - name: '${{ matrix.system }}: with shared libraries' + name: '${{ matrix.system }}: with shared libraries${{ matrix.perfetto && '' and perfetto'' || '''' }}' runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -105,7 +106,8 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | - core.exportVariable('SCCACHE_GHA_VERSION', 'on'); + core.exportVariable('SCCACHE_GHA_ENABLED', 'on'); + core.exportVariable('SCCACHE_GHA_RW_MODE', 'READ_ONLY'); core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on'); core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); @@ -115,14 +117,16 @@ jobs: nix-shell \ -I nixpkgs=./tools/nix/pkgs.nix \ --pure --keep TAR_DIR --keep FLAKY_TESTS \ - --keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ + --keep SCCACHE_GHA_ENABLED --keep SCCACHE_GHA_RW_MODE \ + --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ --arg useSeparateDerivationForV8 true \ + --arg withPerfetto ${{ matrix.perfetto || false }} \ --arg loadJSBuiltinsDynamically false \ - --arg ccache "${NIX_SCCACHE:-null}" \ + --arg ccache '(import {}).sccache' \ --arg devTools '[]' \ --arg benchmarkTools '[]' \ --run ' - make build-ci -j4 V=1 + make build-ci -j4 V=1 && sccache --stop-server ' mv out/Release/node base_node @@ -130,19 +134,22 @@ jobs: run: git reset FETCH_HEAD --hard - name: Re-build Node.js on the merge commit - # ccache is disabled here to avoid polluting the cache. Local build outputs should make this build relatively quick anyway. + # Keep the compiler command unchanged for incremental builds, but never cache PR build outputs. run: | nix-shell \ -I nixpkgs=./tools/nix/pkgs.nix \ - --pure \ + --pure --keep SCCACHE_LOCAL_RW_MODE \ --arg useSeparateDerivationForV8 true \ + --arg withPerfetto ${{ matrix.perfetto || false }} \ --arg loadJSBuiltinsDynamically false \ - --arg ccache 'null' \ + --arg ccache '(import {}).sccache' \ --arg devTools '[]' \ --arg benchmarkTools '[]' \ --run ' make build-ci -j4 V=1 ' + env: + SCCACHE_LOCAL_RW_MODE: READ_ONLY - name: Run benchmark run: |