-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (68 loc) · 1.91 KB
/
checks.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: 🧪 Tests and Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
jobs:
rust-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v4
# Smarter caching action, speeds up build times compared to regular cache:
# https://github.com/Swatinem/rust-cache
- name: Cache Project
uses: Swatinem/rust-cache@v2
# Widely adopted suite of Rust-specific boilerplate actions, especially
# toolchain/cargo use: https://actions-rs.github.io/
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt, clippy
toolchain: ${{ matrix.rust-toolchain }}
- name: Check Format
uses: actions-rs/cargo@v1
with:
args: -- --check
command: fmt
toolchain: ${{ matrix.rust-toolchain }}
- name: Run Linter
uses: actions-rs/cargo@v1
with:
args: -- -D warnings
command: clippy
toolchain: ${{ matrix.rust-toolchain }}
- name: Install Cargo Audit
uses: "actions-rs/cargo@v1"
with:
args: "--force cargo-audit"
command: install
- name: Run Audit on Deps
run: cargo-audit audit
# Only "test" release build on push event.
- name: Test Release
if: github.event_name == 'push'
run: cargo build --release
rust-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Run Tests
run: cargo test