-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.6 KB
/
ci.yml
File metadata and controls
89 lines (74 loc) · 2.6 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
name: CI
on:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.rust }} / ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.rust == 'beta' }}
strategy:
fail-fast: false
matrix:
# Full OS matrix for stable only; MSRV and beta on self-hosted only
include:
# MSRV - ensures we don't use newer Rust features
- rust: "1.85"
os: ubuntu-latest
runner: cachekit
# Stable - primary target, all platforms
- rust: stable
os: ubuntu-latest
runner: cachekit
- rust: stable
os: macos-latest
runner: macos-latest
- rust: stable
os: windows-latest
runner: windows-latest
# Beta - early warning (allowed to fail)
- rust: beta
os: ubuntu-latest
runner: cachekit
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: ${{ matrix.rust }}
components: ${{ matrix.rust != '1.85' && 'rustfmt, clippy' || '' }}
- name: Cache cargo registry
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
cache-all-crates: true
# Formatting and clippy only on stable (lints evolve between versions)
- name: Check formatting
if: matrix.rust == 'stable'
run: cargo fmt --check
- name: Run clippy
if: matrix.rust != '1.85'
run: cargo clippy --all-features -- -D warnings
- name: Run tests (all features)
run: cargo test --all-features
- name: Run FFI tests
if: matrix.rust == 'stable'
run: cargo test --features ffi
security:
runs-on: cachekit
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
cache-all-crates: true
- name: Install security tools
run: cargo install cargo-deny cargo-audit
- name: Check dependencies (licenses & security advisories)
run: cargo deny check
- name: Run cargo audit
run: cargo audit