Skip to content

Commit 531490a

Browse files
committed
Restore CI workflow with check, fmt, clippy, test
1 parent 30e348b commit 531490a

1 file changed

Lines changed: 82 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
build:
14-
name: Build
13+
check:
14+
name: Check
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
@@ -37,5 +37,83 @@ jobs:
3737
path: target
3838
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
3939

40-
- name: Build
41-
run: cargo build --release 2>&1 | head -100
40+
- name: Run cargo check
41+
run: cargo check --all-features
42+
43+
fmt:
44+
name: Format
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install Rust
50+
uses: dtolnay/rust-toolchain@stable
51+
with:
52+
components: rustfmt
53+
54+
- name: Run cargo fmt
55+
run: cargo fmt --all -- --check
56+
57+
clippy:
58+
name: Clippy
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Install Rust
64+
uses: dtolnay/rust-toolchain@stable
65+
with:
66+
components: clippy
67+
68+
- name: Cache cargo registry
69+
uses: actions/cache@v4
70+
with:
71+
path: ~/.cargo/registry
72+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
73+
74+
- name: Cache cargo index
75+
uses: actions/cache@v4
76+
with:
77+
path: ~/.cargo/git
78+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
79+
80+
- name: Cache cargo build
81+
uses: actions/cache@v4
82+
with:
83+
path: target
84+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
85+
86+
- name: Run cargo clippy
87+
run: cargo clippy --all-features -- -D warnings
88+
89+
test:
90+
name: Test
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Install Rust
96+
uses: dtolnay/rust-toolchain@stable
97+
98+
- name: Cache cargo registry
99+
uses: actions/cache@v4
100+
with:
101+
path: ~/.cargo/registry
102+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
103+
104+
- name: Cache cargo index
105+
uses: actions/cache@v4
106+
with:
107+
path: ~/.cargo/git
108+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
109+
110+
- name: Cache cargo build
111+
uses: actions/cache@v4
112+
with:
113+
path: target
114+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
115+
116+
- name: Run tests
117+
run: cargo test --lib
118+
env:
119+
RUST_BACKTRACE: 1

0 commit comments

Comments
 (0)