Skip to content

Commit 7b610f4

Browse files
committed
Adopt Swatinem/rust-cache for faster CI
Signed-off-by: Ondra Pelech <[email protected]>
1 parent a13ba6d commit 7b610f4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
- uses: actions/checkout@v4
3333
- name: Bootc Ubuntu Setup
3434
uses: ./.github/actions/bootc-ubuntu-setup
35+
- name: Setup Rust cache
36+
uses: Swatinem/rust-cache@v2
37+
with:
38+
cache-on-failure: true
39+
save-if: ${{ github.ref == 'refs/heads/main' }}
3540
- name: Validate (default)
3641
run: just validate
3742
# Build container with continuous repository enabled
@@ -41,6 +46,11 @@ jobs:
4146
- uses: actions/checkout@v4
4247
- name: Bootc Ubuntu Setup
4348
uses: ./.github/actions/bootc-ubuntu-setup
49+
- name: Setup Rust cache
50+
uses: Swatinem/rust-cache@v2
51+
with:
52+
cache-on-failure: true
53+
save-if: ${{ github.ref == 'refs/heads/main' }}
4454
- name: Build with continuous repo enabled
4555
run: sudo just build --build-arg=continuous_repo=1
4656
# Check for security vulnerabilities and license compliance
@@ -62,6 +72,11 @@ jobs:
6272
uses: actions/checkout@v4
6373
- name: Bootc Ubuntu Setup
6474
uses: ./.github/actions/bootc-ubuntu-setup
75+
- name: Setup Rust cache
76+
uses: Swatinem/rust-cache@v2
77+
with:
78+
cache-on-failure: true
79+
save-if: ${{ github.ref == 'refs/heads/main' }}
6580
- name: Enable fsverity for /
6681
run: sudo tune2fs -O verity $(findmnt -vno SOURCE /)
6782
- name: Install utils
@@ -76,7 +91,6 @@ jobs:
7691
sudo podman build -t localhost/bootc-fsverity -f ci/Containerfile.install-fsverity
7792
7893
# TODO move into a container, and then have this tool run other containers
79-
export CARGO_INCREMENTAL=0 # because we aren't caching the test runner bits
8094
cargo build --release -p tests-integration
8195
8296
df -h /
@@ -116,6 +130,11 @@ jobs:
116130
- uses: actions/checkout@v4
117131
- name: Bootc Ubuntu Setup
118132
uses: ./.github/actions/bootc-ubuntu-setup
133+
- name: Setup Rust cache
134+
uses: Swatinem/rust-cache@v2
135+
with:
136+
cache-on-failure: true
137+
save-if: ${{ github.ref == 'refs/heads/main' }}
119138
- name: Build mdbook
120139
run: just build-mdbook
121140
# Build containers and disk images for integration testing across OS matrix
@@ -131,6 +150,11 @@ jobs:
131150
- uses: actions/checkout@v4
132151
- name: Bootc Ubuntu Setup
133152
uses: ./.github/actions/bootc-ubuntu-setup
153+
- name: Setup Rust cache
154+
uses: Swatinem/rust-cache@v2
155+
with:
156+
cache-on-failure: true
157+
save-if: ${{ github.ref == 'refs/heads/main' }}
134158
- name: Install qemu-utils
135159
run: sudo apt install -y qemu-utils
136160

0 commit comments

Comments
 (0)