Skip to content

Commit 67e1853

Browse files
committed
ci: rework GitHub workflow
1 parent 3cbc340 commit 67e1853

File tree

1 file changed

+71
-14
lines changed

1 file changed

+71
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,54 @@ jobs:
2222
run: rustup update stable
2323

2424
- name: Make sure necessary tools are installed
25-
run: |
26-
rustup component add clippy --toolchain stable
27-
rustup component add rustfmt --toolchain stable
25+
run: rustup component add clippy --toolchain stable
26+
27+
- name: Setup rust-cache
28+
uses: Swatinem/rust-cache@v2
29+
with:
30+
cache-bin: false
31+
32+
- name: Run cargo clippy
33+
run: cargo clippy --all-targets --all-features -- -D warnings
34+
35+
- name: Check formatting (cargo fmt)
36+
run: cargo fmt --all --check
37+
38+
test:
39+
name: Test (${{ matrix.os }})
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
os: [ubuntu-latest, windows-latest, macos-latest]
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
49+
- name: Install Rust toolchain
50+
run: rustup update stable
51+
52+
- name: Setup rust-cache
53+
uses: Swatinem/rust-cache@v2
54+
with:
55+
cache-bin: false
56+
57+
- name: Run cargo test
58+
run: cargo test --all-features
59+
60+
toml:
61+
name: Format (${{ matrix.os }})
62+
runs-on: ${{ matrix.os }}
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os: [ubuntu-latest, windows-latest, macos-latest]
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
71+
- name: Install Rust toolchain
72+
run: rustup update stable
2873

2974
- name: Setup rust-cache
3075
uses: Swatinem/rust-cache@v2
@@ -37,23 +82,35 @@ jobs:
3782
- name: Install latest taplo
3883
uses: taiki-e/install-action@taplo
3984

40-
- name: Run cargo clippy
41-
run: cargo clippy --all-targets --all-features -- -D warnings
85+
- name: Check unused dependencies (cargo machete)
86+
run: cargo machete
4287

43-
- name: Run cargo test
44-
run: cargo test --all-features
88+
- name: Check TOML formatting (taplo)
89+
run: taplo fmt --check --diff
90+
91+
docs:
92+
name: Docs (${{ matrix.os }})
93+
runs-on: ${{ matrix.os }}
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
os: [ubuntu-latest, windows-latest, macos-latest]
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
102+
- name: Install Rust toolchain
103+
run: rustup update stable
104+
105+
- name: Setup rust-cache
106+
uses: Swatinem/rust-cache@v2
107+
with:
108+
cache-bin: false
45109

46110
- name: Run cargo test --doc
47111
run: cargo test --all-features --doc
48112

49113
- name: Run cargo doc
50114
run: cargo doc --no-deps --all-features
51115

52-
- name: Check unused dependencies (cargo machete)
53-
run: cargo machete
54116

55-
- name: Check formatting (cargo fmt)
56-
run: cargo fmt --all --check
57-
58-
- name: Check TOML formatting (taplo)
59-
run: taplo fmt --check --diff

0 commit comments

Comments
 (0)