Skip to content

Commit fdf017c

Browse files
committed
feat(ci): add mozilla sccache action
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
1 parent f5806e7 commit fdf017c

10 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Set up sccache
2+
description: Install sccache and enable the GitHub Actions cache backend for Rust builds.
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: sccache
8+
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
9+
10+
- name: Configure sccache for Rust
11+
shell: bash
12+
run: |
13+
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
14+
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"

.github/workflows/Coverage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353
shared-key: "${{ runner.os }}-debug"
5454
cache-on-failure: "true"
5555

56+
- name: Set up sccache
57+
uses: ./.github/actions/setup-sccache
58+
5659
- name: Build guest binaries
5760
run: just guests
5861

.github/workflows/PrimeCaches.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,8 @@ jobs:
9999
# https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache
100100
save-if: ${{ github.ref == 'refs/heads/main' }}
101101

102+
- name: Set up sccache
103+
uses: ./.github/actions/setup-sccache
104+
102105
- name: Build host
103106
run: just build ${{ matrix.config }}

.github/workflows/RustNightly.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
. -> target
7474
src/tests/rust_guests -> target
7575
76+
- name: Set up sccache
77+
uses: ./.github/actions/setup-sccache
78+
7679
- name: Install cargo-hyperlight
7780
run: just ensure-cargo-hyperlight
7881

@@ -90,6 +93,8 @@ jobs:
9093
run: just build ${{ matrix.config }}
9194

9295
- name: Run Miri tests
96+
env:
97+
RUSTC_WRAPPER: ""
9398
run: just miri-tests
9499

95100
- name: Run Rust tests

.github/workflows/dep_benchmarks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ jobs:
100100
shared-key: "${{ runner.os }}-${{ inputs.hypervisor }}-release"
101101
save-if: "false"
102102

103+
- name: Set up sccache
104+
uses: ./.github/actions/setup-sccache
105+
103106
- name: Download Rust guests
104107
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
105108
with:

.github/workflows/dep_build_guests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
. -> target
6767
src/tests/rust_guests -> target
6868
69+
- name: Set up sccache
70+
uses: ./.github/actions/setup-sccache
71+
6972
- name: Install cargo-hyperlight
7073
run: just ensure-cargo-hyperlight
7174

.github/workflows/dep_build_test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ jobs:
7070
# https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache
7171
save-if: ${{ github.ref == 'refs/heads/main' }}
7272

73+
- name: Set up sccache
74+
uses: ./.github/actions/setup-sccache
75+
7376
- name: Download Rust guests
7477
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7578
with:
@@ -105,6 +108,8 @@ jobs:
105108

106109
- name: Run Miri tests
107110
if: runner.os == 'Linux'
111+
env:
112+
RUSTC_WRAPPER: ""
108113
run: just miri-tests
109114

110115
- name: Run Rust tests

.github/workflows/dep_code_checks.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ jobs:
6262
. -> target
6363
src/tests/rust_guests -> target
6464
65+
- name: Set up sccache
66+
uses: ./.github/actions/setup-sccache
67+
6568
- name: Ensure up-to-date Cargo.lock
6669
run: |
6770
cargo fetch --locked
@@ -128,6 +131,9 @@ jobs:
128131
. -> target
129132
src/tests/rust_guests -> target
130133
134+
- name: Set up sccache
135+
uses: ./.github/actions/setup-sccache
136+
131137
- name: Ensure up-to-date Cargo.lock
132138
run: |
133139
cargo fetch --locked

.github/workflows/dep_fuzzing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939

40+
- name: Set up sccache
41+
uses: ./.github/actions/setup-sccache
42+
4043
- name: Download Rust guests
4144
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4245
with:

.github/workflows/dep_run_examples.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
shared-key: "${{ runner.os }}-${{ inputs.hypervisor }}-${{ inputs.config }}"
6868
save-if: "false"
6969

70+
- name: Set up sccache
71+
uses: ./.github/actions/setup-sccache
72+
7073
- name: Download Rust guests
7174
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7275
with:

0 commit comments

Comments
 (0)