Skip to content

Commit 2007867

Browse files
authored
ci: split in separate jobs (#263)
1 parent 9abcbd8 commit 2007867

1 file changed

Lines changed: 47 additions & 12 deletions

File tree

.github/workflows/rust-checks.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,73 @@ env:
99
CARGO_TERM_COLOR: always
1010

1111
jobs:
12-
lint-and-test:
13-
name: Lint and Test
12+
fmt:
13+
name: Formatting
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18-
18+
1919
- name: Install Rust toolchain
2020
uses: dtolnay/rust-toolchain@nightly
2121
with:
22-
components: clippy, rustfmt
23-
24-
- name: Cache dependencies
25-
uses: Swatinem/rust-cache@v2
26-
27-
- name: Check Cargo.lock is up-to-date
28-
run: cargo check --locked --workspace
22+
components: rustfmt
2923

3024
- name: Check formatting
3125
run: cargo fmt --check --all
3226

27+
clippy:
28+
name: Clippy
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Install Rust toolchain
35+
uses: dtolnay/rust-toolchain@nightly
36+
with:
37+
components: clippy
38+
39+
- name: Cache dependencies
40+
uses: Swatinem/rust-cache@v2
41+
3342
- name: Check clippy
34-
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
43+
run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
44+
45+
doc:
46+
name: Documentation
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
52+
- name: Install Rust toolchain
53+
uses: dtolnay/rust-toolchain@nightly
54+
55+
- name: Cache dependencies
56+
uses: Swatinem/rust-cache@v2
3557

3658
- name: Check documentation
3759
run: cargo doc --workspace --no-deps
3860
env:
3961
RUSTDOCFLAGS: "-D warnings"
4062

63+
test:
64+
name: Tests
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@v4
69+
70+
- name: Install Rust toolchain
71+
uses: dtolnay/rust-toolchain@nightly
72+
73+
- name: Cache dependencies
74+
uses: Swatinem/rust-cache@v2
75+
4176
- name: Run all tests
4277
env:
4378
RPC_URL: ${{ secrets.RPC_URL }}
4479
RPC_HEADERS: ${{ secrets.RPC_HEADERS }}
4580
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
run: cargo test --release --workspace --all-features -- --no-capture
81+
run: cargo test --release --workspace --all-features -- --no-capture

0 commit comments

Comments
 (0)