-
Notifications
You must be signed in to change notification settings - Fork 4
31 lines (29 loc) · 927 Bytes
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
on: [push, pull_request]
name: Test
jobs:
build:
name: Build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
# will try to use previous cache if there was a miss. Might still be useful, but increases
# cache size continuously when updating dependencies
restore-keys: ${{ runner.os }}-cargo-
- run: cargo build
- run: cargo test
if: always()
# these will run even if the build fails
- run: cargo fmt --all -- --check
if: always()
- run: cargo clippy -- -D warnings
if: always()