Skip to content

Commit

Permalink
Share a build cache between CI jobs.
Browse files Browse the repository at this point in the history
Let's not do the work twice.
  • Loading branch information
SamirTalwar committed Mar 11, 2024
1 parent 0ffd207 commit a51338a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 44 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
rustup show
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs

- name: build
run: |
Expand All @@ -36,3 +38,7 @@ jobs:
git diff Cargo.lock
exit 1
fi
- name: clippy
run: |
cargo clippy --release --all-targets --all-features
22 changes: 22 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: format

on:
push:

jobs:
cargo-fmt:
name: check formatting with cargo fmt
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4

- name: install tools
run: |
rustup show
- name: check formatting
run: |
cargo fmt --all --check
43 changes: 0 additions & 43 deletions .github/workflows/lint.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
rustup show
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs

- name: run tests
run: cargo test
run: cargo test --release --all-targets --all-features

0 comments on commit a51338a

Please sign in to comment.