Skip to content

Commit

Permalink
Cache CI builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Sep 24, 2024
1 parent cabe835 commit 045772d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits: save about 7s per workflow by skipping the actual cache write
# downsides: PRs that update rust version or changes deps will be slower to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --workspace --all-features
- run: cargo test --workspace --all-features
Expand All @@ -29,6 +35,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand Down

0 comments on commit 045772d

Please sign in to comment.