aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/rust.yml43
1 files changed, 43 insertions, 0 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 0000000..9be2f41
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,43 @@
1name: Rust
2
3on:
4 push:
5 branches: [ main ]
6 pull_request:
7 branches: [ main ]
8
9env:
10 CARGO_TERM_COLOR: always
11
12jobs:
13 test:
14 runs-on: ubuntu-latest
15
16 steps:
17 - uses: actions/checkout@v4
18
19 - name: Install Rust
20 uses: dtolnay/rust-toolchain@stable
21
22 - name: Cache cargo registry
23 uses: actions/cache@v3
24 with:
25 path: |
26 ~/.cargo/registry
27 ~/.cargo/git
28 target
29 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
30 restore-keys: |
31 ${{ runner.os }}-cargo-
32
33 - name: Check formatting
34 run: cargo fmt --check
35
36 - name: Run clippy
37 run: cargo clippy -- -D warnings
38
39 - name: Build
40 run: cargo build --verbose
41
42 - name: Run tests
43 run: cargo test --verbose \ No newline at end of file