diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index b3a1168d69a4c5..876f6c842e10e0 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -102,9 +102,9 @@ jobs: needs: build-tarball runs-on: ubuntu-24.04 env: - CC: sccache clang-19 - CXX: sccache clang++-19 - SCCACHE_GHA_ENABLED: 'true' + CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang-19' || 'clang-19' }} + CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang++-19' || 'clang++-19' }} + SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} SCCACHE_IDLE_TIMEOUT: '0' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -122,6 +122,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true - name: Set up sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 with: version: v0.12.0 diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml index 25445b760ad9f4..9f2e5000457bb1 100644 --- a/.github/workflows/coverage-linux-without-intl.yml +++ b/.github/workflows/coverage-linux-without-intl.yml @@ -37,9 +37,9 @@ env: PYTHON_VERSION: '3.14' FLAKY_TESTS: keep_retrying CLANG_VERSION: '19' - CC: sccache clang-19 - CXX: sccache clang++-19 - SCCACHE_GHA_ENABLED: 'true' + CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang-19' || 'clang-19' }} + CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang++-19' || 'clang++-19' }} + SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} SCCACHE_IDLE_TIMEOUT: '0' permissions: @@ -63,6 +63,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true - name: Set up sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 with: version: v0.12.0 diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index d2495ef60c3ef2..f6184b360f497a 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -37,9 +37,9 @@ env: PYTHON_VERSION: '3.14' FLAKY_TESTS: keep_retrying CLANG_VERSION: '19' - CC: sccache clang-19 - CXX: sccache clang++-19 - SCCACHE_GHA_ENABLED: 'true' + CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang-19' || 'clang-19' }} + CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang++-19' || 'clang++-19' }} + SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} SCCACHE_IDLE_TIMEOUT: '0' permissions: @@ -63,6 +63,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true - name: Set up sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 with: version: v0.12.0 diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index bda70922bc5e0d..7e30b846906047 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -34,9 +34,9 @@ env: PYTHON_VERSION: '3.14' FLAKY_TESTS: keep_retrying CLANG_VERSION: '19' - CC: sccache clang-19 - CXX: sccache clang++-19 - SCCACHE_GHA_ENABLED: 'true' + CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang-19' || 'clang-19' }} + CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang++-19' || 'clang++-19' }} + SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} SCCACHE_IDLE_TIMEOUT: '0' permissions: @@ -60,6 +60,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true - name: Set up sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 with: version: v0.12.0 diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 1e74796563f27d..fe2a1f9a7d792d 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -34,9 +34,9 @@ env: PYTHON_VERSION: '3.14' FLAKY_TESTS: keep_retrying CLANG_VERSION: '19' - CC: sccache clang-19 - CXX: sccache clang++-19 - SCCACHE_GHA_ENABLED: 'true' + CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang-19' || 'clang-19' }} + CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache clang++-19' || 'clang++-19' }} + SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} SCCACHE_IDLE_TIMEOUT: '0' RUSTC_VERSION: '1.82' @@ -70,6 +70,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true - name: Set up sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 with: version: v0.12.0 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 3920b9a365ebae..ee85e1ea8418da 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -80,9 +80,9 @@ jobs: fail-fast: false runs-on: macos-15 env: - CC: sccache gcc - CXX: sccache g++ - SCCACHE_GHA_ENABLED: 'true' + CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache gcc' || 'gcc' }} + CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache g++' || 'g++' }} + SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} SCCACHE_IDLE_TIMEOUT: '0' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -101,6 +101,7 @@ jobs: rustup override set "$RUSTC_VERSION" rustup --version - name: Set up sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 with: version: v0.12.0 diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml index 7f92b98929b8be..902b71e13f1a30 100644 --- a/.github/workflows/test-shared.yml +++ b/.github/workflows/test-shared.yml @@ -175,6 +175,7 @@ jobs: authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Configure sccache + if: github.base_ref == 'main' || github.ref_name == 'main' uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | @@ -195,9 +196,9 @@ jobs: nix-shell \ -I nixpkgs=./tools/nix/pkgs.nix \ --pure --keep TAR_DIR --keep FLAKY_TESTS \ - --keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ + ${{ (github.base_ref == 'main' || github.ref_name == 'main') && '--keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN' || '' }} \ --arg loadJSBuiltinsDynamically false \ - --arg ccache '(import {}).sccache' \ + ${{ (github.base_ref == 'main' || github.ref_name == 'main') && '--arg ccache ''(import {}).sccache''' || '' }} \ --arg devTools '[]' \ --arg benchmarkTools '[]' \ ${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }}