From 27b500bcc530a30db53391d5ac1e7e276bdb5a2e Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 8 Jul 2026 11:03:53 -0500 Subject: [PATCH] Add sccache to Rust CI jobs --- .../setup-integration-test-env/action.yml | 9 ++++ .github/workflows/format.yml | 8 ++++ .github/workflows/test.yml | 48 +++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/.github/actions/setup-integration-test-env/action.yml b/.github/actions/setup-integration-test-env/action.yml index 841d8d5b..36823e70 100644 --- a/.github/actions/setup-integration-test-env/action.yml +++ b/.github/actions/setup-integration-test-env/action.yml @@ -58,6 +58,15 @@ runs: target: wasm32-wasip1 cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Cache Viceroy binary if: ${{ inputs.install-viceroy == 'true' }} id: cache-viceroy diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 4893a955..be6df0d1 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -29,6 +29,14 @@ jobs: components: "clippy, rustfmt" cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Run cargo fmt uses: actions-rust-lang/rustfmt@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f2717dc..42753c49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,14 @@ jobs: target: wasm32-wasip1 cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Cache Viceroy binary id: cache-viceroy uses: actions/cache@v4 @@ -69,6 +77,14 @@ jobs: target: wasm32-wasip1 cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Build Axum adapter run: cargo build -p trusted-server-adapter-axum @@ -103,6 +119,14 @@ jobs: target: wasm32-unknown-unknown cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Check Cloudflare adapter (native host) run: cargo check -p trusted-server-adapter-cloudflare @@ -130,6 +154,14 @@ jobs: target: wasm32-wasip1 cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Check Spin adapter (native host) run: cargo check -p trusted-server-adapter-spin @@ -169,6 +201,14 @@ jobs: components: clippy, rustfmt cache-shared-key: cargo-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + - name: Format check (parity test crate) run: cargo fmt --manifest-path crates/trusted-server-integration-tests/Cargo.toml -- --check @@ -201,6 +241,14 @@ jobs: components: "clippy, rustfmt" cache-shared-key: cargo-cli-${{ runner.os }} + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Configure sccache for Rust + run: | + echo "SCCACHE_GHA_ENABLED=on" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" + # No separate `cargo fmt` here: `trusted-server-cli` is a workspace member, # so the main `cargo fmt --all` job already formats it. Clippy still needs a # native run — the workspace clippy jobs are wasm/adapter-scoped and never