Skip to content

Commit 90714e2

Browse files
d-e-s-oinsearchoflosttime
authored andcommitted
Enable dependency caching in CI
Just stumbled over the Swatinem/rust-cache action which seems to be a low-key way for caching dependencies once built. As per my brief testing here [0] [1] the relevant runtime of the two jobs affected decrease from ~4:30 min down to ~3:30, if not better. Let's give it a try. [0] https://github.com/danielocfb/libbpf-rs/actions/runs/3970473231 [1] https://github.com/danielocfb/libbpf-rs/actions/runs/3970565645 Signed-off-by: Daniel Müller <deso@posteo.net>
1 parent a2a820d commit 90714e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/rust.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
run: |
4747
sudo apt-get install -y clang-14 libelf-dev zlib1g-dev
4848
sudo rm -f /bin/clang && sudo ln -s /usr/bin/clang-14 /bin/clang
49+
- uses: Swatinem/rust-cache@v2.2.0
4950
- name: Build
5051
run: cargo build --verbose --workspace --exclude runqslower
5152
- name: Run tests
@@ -76,6 +77,7 @@ jobs:
7677
toolchain: 1.58.0
7778
components: rustfmt
7879
default: true
80+
- uses: Swatinem/rust-cache@v2.2.0
7981
- name: Build
8082
run: cargo build --verbose --workspace --exclude runqslower
8183

@@ -91,6 +93,7 @@ jobs:
9193
profile: minimal
9294
toolchain: stable
9395
override: true
96+
- uses: Swatinem/rust-cache@v2.2.0
9497
- run: RUSTFLAGS="$RUSTFLAGS -L /usr/lib/x86_64-linux-gnu" cargo build --package capable --features=static
9598
clippy:
9699
name: Lint with clippy
@@ -105,6 +108,7 @@ jobs:
105108
toolchain: stable
106109
components: clippy
107110
override: true
111+
- uses: Swatinem/rust-cache@v2.2.0
108112
- run: cargo clippy --no-deps --all-targets --tests -- -D warnings
109113
rustfmt:
110114
name: Check code formatting

0 commit comments

Comments
 (0)