Skip to content

Commit 4e5fe19

Browse files
committed
build: improve ci to use latest version of rust
- Jobs run in parallel independent of each other. - Separate caching for each jobs.
1 parent 051d051 commit 4e5fe19

File tree

1 file changed

+45
-29
lines changed

1 file changed

+45
-29
lines changed

.github/workflows/ci.yaml

+45-29
Original file line numberDiff line numberDiff line change
@@ -15,60 +15,76 @@ env:
1515
CARGO_PROFILE_TEST_DEBUG: 0
1616

1717
jobs:
18-
lint:
18+
cargo-fmt:
19+
name: Cargo fmt
1920
runs-on: ubuntu-latest
20-
timeout-minutes: 5
2121

2222
steps:
23-
- name: Checkout project
23+
- name: Fetch Repository
2424
uses: actions/checkout@v4
2525

26-
- name: Setup Rust
27-
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4
26+
- name: Install stable toolchain
27+
uses: actions-rust-lang/setup-rust-toolchain@v1
2828
with:
2929
toolchain: stable
30-
components: clippy, rustfmt
30+
components: rustfmt
3131

3232
- name: Caching
33-
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
33+
uses: Swatinem/rust-cache@v2
3434
with:
3535
cache-all-crates: true
3636
save-if: ${{ github.ref == 'refs/heads/master' }}
37-
cache-provider: 'github'
37+
cache-provider: "github"
3838

39-
- name: Run linter
40-
uses: giraffate/clippy-action@871cc4173f2594435c7ea6b0bce499cf6c2164a1
39+
- name: Rustfmt Check
40+
run: cargo fmt --all --check
41+
42+
cargo-clippy:
43+
name: Cargo clippy
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Fetch Repository
48+
uses: actions/checkout@v4
49+
50+
- name: Install stable toolchain
51+
uses: actions-rust-lang/setup-rust-toolchain@v1
4152
with:
42-
github_token: ${{ secrets.GITHUB_TOKEN }}
43-
clippy_flags: --all-features -- -D warnings
44-
reporter: github-pr-review
53+
components: clippy
4554

46-
- name: Run formatter
47-
run: cargo fmt --all -- --check
55+
- name: Caching
56+
uses: Swatinem/rust-cache@v2
57+
with:
58+
cache-all-crates: true
59+
save-if: ${{ github.ref == 'refs/heads/master' }}
60+
cache-provider: "github"
4861

49-
test:
50-
needs: lint
62+
- name: Clippy Check
63+
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
64+
65+
cargo-test:
66+
name: Cargo test
5167
runs-on: ubuntu-latest
52-
timeout-minutes: 10
5368

5469
steps:
55-
- name: Checkout project
70+
- name: Fetch Repository
5671
uses: actions/checkout@v4
5772

58-
- name: Setup Rust
59-
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4
73+
- name: Install stable toolchain
74+
uses: actions-rust-lang/setup-rust-toolchain@v1
6075

6176
- name: Caching
62-
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
77+
uses: Swatinem/rust-cache@v2
6378
with:
6479
cache-all-crates: true
6580
save-if: ${{ github.ref == 'refs/heads/master' }}
66-
cache-provider: 'github'
81+
cache-provider: "github"
6782

68-
- name: Install nextest
69-
uses: taiki-e/install-action@9903ab6feadaec33945de535fe9d181b91802a55
70-
with:
71-
tool: nextest
83+
- name: Install latest nextest release
84+
uses: taiki-e/install-action@nextest
7285

73-
- name: Run tests
74-
run: cargo nextest run --all-features
86+
- name: Test with latest nextest release
87+
uses: actions-rs/cargo@v1
88+
with:
89+
command: nextest
90+
args: run

0 commit comments

Comments
 (0)