-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (55 loc) · 1.65 KB
/
ci.yml
File metadata and controls
70 lines (55 loc) · 1.65 KB
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
name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['**']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
name: Audit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: cargo-audit cache restore
id: cargo-audit_cache_restore
uses: actions/cache/restore@v4
with:
path: ~/.cargo/bin/cargo-audit
key: ${{ runner.os }}-cargo-audit
- run: cargo install cargo-audit
if: steps.cargo-audit_cache_restore.outputs.cache-hit != 'true'
- name: cargo-audit cache save
id: cargo-audit_cache_save
uses: actions/cache/save@v4
if: always() && steps.cargo-audit_cache_restore.outputs.cache-hit != 'true'
with:
path: ~/.cargo/bin/cargo-audit
key: ${{ runner.os }}-cargo-audit
- uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: nextest
- name: Run cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run cargo nextest
run: cargo nextest run --all-features