Skip to content

Commit 00cafc6

Browse files
committed
feat: add CI workflow
1 parent 43c3b01 commit 00cafc6

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/ci.yml

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

0 commit comments

Comments
 (0)