diff --git a/.github/actions/setup-sccache/action.yml b/.github/actions/setup-sccache/action.yml new file mode 100644 index 000000000..a3130739e --- /dev/null +++ b/.github/actions/setup-sccache/action.yml @@ -0,0 +1,14 @@ +name: Set up sccache +description: Install sccache and enable the GitHub Actions cache backend for Rust builds. + +runs: + using: composite + steps: + - name: sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 + + - name: Configure sccache for Rust + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" diff --git a/.github/workflows/Coverage.yml b/.github/workflows/Coverage.yml index 180049479..862c1caad 100644 --- a/.github/workflows/Coverage.yml +++ b/.github/workflows/Coverage.yml @@ -53,6 +53,9 @@ jobs: shared-key: "${{ runner.os }}-debug" cache-on-failure: "true" + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Build guest binaries run: just guests diff --git a/.github/workflows/PrimeCaches.yml b/.github/workflows/PrimeCaches.yml index a6b935847..0326d3316 100644 --- a/.github/workflows/PrimeCaches.yml +++ b/.github/workflows/PrimeCaches.yml @@ -99,5 +99,8 @@ jobs: # https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache save-if: ${{ github.ref == 'refs/heads/main' }} + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Build host run: just build ${{ matrix.config }} diff --git a/.github/workflows/RustNightly.yml b/.github/workflows/RustNightly.yml index cfd5874ba..3c4ea38f8 100644 --- a/.github/workflows/RustNightly.yml +++ b/.github/workflows/RustNightly.yml @@ -73,6 +73,9 @@ jobs: . -> target src/tests/rust_guests -> target + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Install cargo-hyperlight run: just ensure-cargo-hyperlight @@ -90,7 +93,7 @@ jobs: run: just build ${{ matrix.config }} - name: Run Miri tests - run: just miri-tests + run: env -u RUSTC_WRAPPER just miri-tests - name: Run Rust tests run: | diff --git a/.github/workflows/dep_benchmarks.yml b/.github/workflows/dep_benchmarks.yml index 167b2e846..6b4519aa6 100644 --- a/.github/workflows/dep_benchmarks.yml +++ b/.github/workflows/dep_benchmarks.yml @@ -100,6 +100,9 @@ jobs: shared-key: "${{ runner.os }}-${{ inputs.hypervisor }}-release" save-if: "false" + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Download Rust guests uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: diff --git a/.github/workflows/dep_build_guests.yml b/.github/workflows/dep_build_guests.yml index d36caef90..214fe4648 100644 --- a/.github/workflows/dep_build_guests.yml +++ b/.github/workflows/dep_build_guests.yml @@ -66,6 +66,9 @@ jobs: . -> target src/tests/rust_guests -> target + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Install cargo-hyperlight run: just ensure-cargo-hyperlight diff --git a/.github/workflows/dep_build_test.yml b/.github/workflows/dep_build_test.yml index 91ce867aa..f66b3a1dd 100644 --- a/.github/workflows/dep_build_test.yml +++ b/.github/workflows/dep_build_test.yml @@ -70,6 +70,9 @@ jobs: # https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache save-if: ${{ github.ref == 'refs/heads/main' }} + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Download Rust guests uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: @@ -105,7 +108,7 @@ jobs: - name: Run Miri tests if: runner.os == 'Linux' - run: just miri-tests + run: env -u RUSTC_WRAPPER just miri-tests - name: Run Rust tests run: | diff --git a/.github/workflows/dep_code_checks.yml b/.github/workflows/dep_code_checks.yml index 2ca9d4c90..6c17874f9 100644 --- a/.github/workflows/dep_code_checks.yml +++ b/.github/workflows/dep_code_checks.yml @@ -62,6 +62,9 @@ jobs: . -> target src/tests/rust_guests -> target + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Ensure up-to-date Cargo.lock run: | cargo fetch --locked @@ -128,6 +131,9 @@ jobs: . -> target src/tests/rust_guests -> target + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Ensure up-to-date Cargo.lock run: | cargo fetch --locked diff --git a/.github/workflows/dep_fuzzing.yml b/.github/workflows/dep_fuzzing.yml index 483cfc779..3e8f0cea2 100644 --- a/.github/workflows/dep_fuzzing.yml +++ b/.github/workflows/dep_fuzzing.yml @@ -37,6 +37,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Download Rust guests uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: diff --git a/.github/workflows/dep_run_examples.yml b/.github/workflows/dep_run_examples.yml index c3e83d5cc..778c83d3d 100644 --- a/.github/workflows/dep_run_examples.yml +++ b/.github/workflows/dep_run_examples.yml @@ -67,6 +67,9 @@ jobs: shared-key: "${{ runner.os }}-${{ inputs.hypervisor }}-${{ inputs.config }}" save-if: "false" + - name: Set up sccache + uses: ./.github/actions/setup-sccache + - name: Download Rust guests uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: