Skip to content

Commit c4bdbdc

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

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ 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-all-crates: true
39+
save-if: ${{ github.ref == 'refs/heads/main' }}
40+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
3541
- name: Validate (default)
3642
run: just validate
3743
# Build container with continuous repository enabled
@@ -41,6 +47,12 @@ jobs:
4147
- uses: actions/checkout@v4
4248
- name: Bootc Ubuntu Setup
4349
uses: ./.github/actions/bootc-ubuntu-setup
50+
- name: Setup Rust cache
51+
uses: Swatinem/rust-cache@v2
52+
with:
53+
cache-all-crates: true
54+
save-if: ${{ github.ref == 'refs/heads/main' }}
55+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
4456
- name: Build with continuous repo enabled
4557
run: sudo just build --build-arg=continuous_repo=1
4658
# Check for security vulnerabilities and license compliance
@@ -62,6 +74,12 @@ jobs:
6274
uses: actions/checkout@v4
6375
- name: Bootc Ubuntu Setup
6476
uses: ./.github/actions/bootc-ubuntu-setup
77+
- name: Setup Rust cache
78+
uses: Swatinem/rust-cache@v2
79+
with:
80+
cache-all-crates: true
81+
save-if: ${{ github.ref == 'refs/heads/main' }}
82+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
6583
- name: Enable fsverity for /
6684
run: sudo tune2fs -O verity $(findmnt -vno SOURCE /)
6785
- name: Install utils
@@ -76,7 +94,6 @@ jobs:
7694
sudo podman build -t localhost/bootc-fsverity -f ci/Containerfile.install-fsverity
7795
7896
# 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
8097
cargo build --release -p tests-integration
8198
8299
df -h /
@@ -116,6 +133,12 @@ jobs:
116133
- uses: actions/checkout@v4
117134
- name: Bootc Ubuntu Setup
118135
uses: ./.github/actions/bootc-ubuntu-setup
136+
- name: Setup Rust cache
137+
uses: Swatinem/rust-cache@v2
138+
with:
139+
cache-all-crates: true
140+
save-if: ${{ github.ref == 'refs/heads/main' }}
141+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
119142
- name: Build mdbook
120143
run: just build-mdbook
121144
# Build containers and disk images for integration testing across OS matrix
@@ -131,6 +154,12 @@ jobs:
131154
- uses: actions/checkout@v4
132155
- name: Bootc Ubuntu Setup
133156
uses: ./.github/actions/bootc-ubuntu-setup
157+
- name: Setup Rust cache
158+
uses: Swatinem/rust-cache@v2
159+
with:
160+
cache-all-crates: true
161+
save-if: ${{ github.ref == 'refs/heads/main' }}
162+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
134163
- name: Install qemu-utils
135164
run: sudo apt install -y qemu-utils
136165

0 commit comments

Comments
 (0)