Skip to content

Commit 2af657a

Browse files
committed
Add simple CI to run cargo test
1 parent 17e56c3 commit 2af657a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_and_test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Set up Rust
14+
uses: dtolnay/rust-toolchain@stable
15+
with:
16+
toolchain: stable
17+
components: rustfmt, clippy
18+
19+
- name: Cache dependencies
20+
uses: actions/cache@v3
21+
with:
22+
path: |
23+
~/.cargo/registry
24+
~/.cargo/git
25+
target
26+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-cargo-
29+
30+
- name: Run cargo clippy
31+
run: cargo clippy -- -D warnings
32+
33+
- name: Run cargo test
34+
run: cargo test

0 commit comments

Comments
 (0)