diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 51b41aa90..5d3103d7b 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -95,9 +95,8 @@ jobs: run: working-directory: codex-rs env: - # Speed up repeated builds across CI runs by caching compiled objects (non-Windows). - USE_SCCACHE: ${{ startsWith(matrix.runner, 'windows') && 'false' || 'true' }} - RUSTC_WRAPPER: ${{ startsWith(matrix.runner, 'windows') && '' || 'sccache' }} + # Speed up repeated builds across CI runs by caching compiled objects. + RUSTC_WRAPPER: sccache CARGO_INCREMENTAL: "0" SCCACHE_CACHE_SIZE: 10G @@ -171,14 +170,12 @@ jobs: # Install and restore sccache cache - name: Install sccache - if: ${{ env.USE_SCCACHE == 'true' }} uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: sccache version: 0.7.5 - name: Configure sccache backend - if: ${{ env.USE_SCCACHE == 'true' }} shell: bash run: | set -euo pipefail @@ -192,7 +189,7 @@ jobs: fi - name: Restore sccache cache (fallback) - if: ${{ env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' }} + if: ${{ env.SCCACHE_GHA_ENABLED != 'true' }} id: cache_sccache_restore uses: actions/cache/restore@v4 with: @@ -277,7 +274,7 @@ jobs: key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('codex-rs/rust-toolchain.toml') }} - name: Save sccache cache (fallback) - if: always() && !cancelled() && env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' + if: always() && !cancelled() && env.SCCACHE_GHA_ENABLED != 'true' continue-on-error: true uses: actions/cache/save@v4 with: @@ -285,12 +282,12 @@ jobs: key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }} - name: sccache stats - if: always() && env.USE_SCCACHE == 'true' + if: always() continue-on-error: true run: sccache --show-stats || true - name: sccache summary - if: always() && env.USE_SCCACHE == 'true' + if: always() shell: bash run: | { @@ -329,9 +326,7 @@ jobs: run: working-directory: codex-rs env: - # Speed up repeated builds across CI runs by caching compiled objects (non-Windows). - USE_SCCACHE: ${{ startsWith(matrix.runner, 'windows') && 'false' || 'true' }} - RUSTC_WRAPPER: ${{ startsWith(matrix.runner, 'windows') && '' || 'sccache' }} + RUSTC_WRAPPER: sccache CARGO_INCREMENTAL: "0" SCCACHE_CACHE_SIZE: 10G @@ -375,14 +370,12 @@ jobs: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}- - name: Install sccache - if: ${{ env.USE_SCCACHE == 'true' }} uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: sccache version: 0.7.5 - name: Configure sccache backend - if: ${{ env.USE_SCCACHE == 'true' }} shell: bash run: | set -euo pipefail @@ -396,7 +389,7 @@ jobs: fi - name: Restore sccache cache (fallback) - if: ${{ env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' }} + if: ${{ env.SCCACHE_GHA_ENABLED != 'true' }} id: cache_sccache_restore uses: actions/cache/restore@v4 with: @@ -431,7 +424,7 @@ jobs: key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('codex-rs/rust-toolchain.toml') }} - name: Save sccache cache (fallback) - if: always() && !cancelled() && env.USE_SCCACHE == 'true' && env.SCCACHE_GHA_ENABLED != 'true' + if: always() && !cancelled() && env.SCCACHE_GHA_ENABLED != 'true' continue-on-error: true uses: actions/cache/save@v4 with: @@ -439,12 +432,12 @@ jobs: key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }} - name: sccache stats - if: always() && env.USE_SCCACHE == 'true' + if: always() continue-on-error: true run: sccache --show-stats || true - name: sccache summary - if: always() && env.USE_SCCACHE == 'true' + if: always() shell: bash run: | {