Skip to content

Commit 23573dd

Browse files
committed
ci: add workflow for build, test, and clippy checks
1 parent 2bf73dd commit 23573dd

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rust
16+
uses: dtolnay/rust-toolchain@stable
17+
with:
18+
components: clippy
19+
20+
- name: Cache cargo registry
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.cargo/registry
24+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
25+
26+
- name: Cache cargo index
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cargo/git
30+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
31+
32+
- name: Cache cargo build
33+
uses: actions/cache@v4
34+
with:
35+
path: target
36+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
37+
38+
- name: Build
39+
run: cargo build --verbose
40+
41+
- name: Run tests
42+
run: cargo test --verbose
43+
44+
- name: Run clippy
45+
run: cargo clippy --all-targets --all-features -- -D warnings

0 commit comments

Comments
 (0)