-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (107 loc) · 3.79 KB
/
Copy pathtests.yaml
File metadata and controls
131 lines (107 loc) · 3.79 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Tests (Unit)
# ------------------------------------------------------------------------------
# Workflow Settings
# ------------------------------------------------------------------------------
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
debug:
description: "Enable verbose test output (V=1)"
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
env:
CARGO_TERM_COLOR: always
V: ${{ inputs.debug && '1' || '' }}
jobs:
# ---------------------------------------------------------------------------
# Lint (fmt + clippy + rustdoc)
# ---------------------------------------------------------------------------
lint:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install nightly Rust (for rustfmt)
uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly-2026-03-28 (rustc 1.96.0)
with:
components: rustfmt
- name: Install stable Rust
uses: dtolnay/rust-toolchain@10c3493d811a9096cee4fdf287e41e852f6a51ba # 1.94.0
with:
components: clippy
- name: Cache Cargo registry and build artifacts
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-rust-1.94.0-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-1.94.0-cargo-
save-always: true
- name: Lint
run: make lint
- name: Documentation
run: make doc
# ---------------------------------------------------------------------------
# Build + test
# ---------------------------------------------------------------------------
test:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install stable Rust
uses: dtolnay/rust-toolchain@10c3493d811a9096cee4fdf287e41e852f6a51ba # 1.94.0
- name: Cache Cargo registry and build artifacts
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-rust-1.94.0-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-1.94.0-cargo-
save-always: true
- name: Build
run: make build
- name: Tests
run: make test
# ---------------------------------------------------------------------------
# Supply-chain audit
# ---------------------------------------------------------------------------
audit:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install stable Rust
uses: dtolnay/rust-toolchain@10c3493d811a9096cee4fdf287e41e852f6a51ba # 1.94.0
- name: Cache Cargo audit tools
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-audit-bins
save-always: true
- name: Install audit tools
run: |
command -v cargo-audit || cargo install cargo-audit
command -v cargo-deny || cargo install cargo-deny
- name: Audit
run: make audit