Skip to content

Commit

Permalink
Cache build artifacts in CI
Browse files Browse the repository at this point in the history
Our CI is somewhat slow, mostly owing to the long time it takes to build
the slew of dependencies we have.
To mitigate this problem, cache build artifacts so that they can be
reused between CI runs.
  • Loading branch information
d-e-s-o committed Jun 23, 2024
1 parent 5ed312a commit 5ca0d1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.profile }}-${{ matrix.args }}
- name: Build ${{ matrix.profile }}
run: cargo build --profile=${{ matrix.profile }} --all-targets ${{ matrix.args }}
build-minimum:
Expand All @@ -55,6 +58,7 @@ jobs:
# Please adjust README and rust-version field in Cargo.toml files when
# bumping version.
toolchain: 1.63.0
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --features=vendored-openssl --locked
test:
Expand All @@ -64,6 +68,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
- name: Test and gather coverage
run: cargo llvm-cov --lcov --output-path lcov.info --ignore-filename-regex=src/api/v2/de.rs
env:
Expand All @@ -81,6 +86,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --no-deps --all-targets --all-features -- -A unknown_lints -D warnings
rustfmt:
name: Check code formatting
Expand All @@ -99,6 +105,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: |
cargo doc --no-deps
# Explicitly run doc tests as cargo-llvm-cov currently does not.
Expand Down

0 comments on commit 5ca0d1b

Please sign in to comment.