-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (98 loc) · 2.98 KB
/
ci.yml
File metadata and controls
115 lines (98 loc) · 2.98 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: cargo fmt
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test
run: cargo test --workspace --all-targets
- name: cargo doc
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings
msrv:
name: msrv (rust 1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust 1.88
uses: dtolnay/rust-toolchain@1.88
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
key: msrv-1.88
- name: cargo build (MSRV)
run: cargo build --workspace --all-targets
- name: cargo test (MSRV)
run: cargo test --workspace --all-targets
audit:
name: cargo-audit (security advisories)
runs-on: ubuntu-latest
# Non-blocking on first land: an open advisory in a transitive dep should
# surface as a CI annotation but not red-light unrelated changes. Flip
# continue-on-error to false once the baseline is clean.
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
benches-compile:
name: criterion benches (compile only)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: benches
- name: cargo bench --no-run
run: cargo bench --workspace --no-run
coverage:
name: coverage (llvm-cov)
runs-on: ubuntu-latest
# Non-blocking on first land — coverage gates make sense once we have
# 5+ baselines and a target floor agreed. Flip continue-on-error to
# false once that lands.
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
with:
key: coverage
- name: cargo llvm-cov (lcov)
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}