-
-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (123 loc) · 4.06 KB
/
ci.yml
File metadata and controls
135 lines (123 loc) · 4.06 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
132
133
134
135
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Note: CUDA tests require NVIDIA GPU + nvcc and are skipped in CI.
# CUDA features are opt-in (not default) so workspace builds succeed without nvcc.
# Run CUDA tests locally with: cargo test -p ringkernel-cuda --features cuda
jobs:
# Format check
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
# Clippy lints (production code only — tests may use unwrap())
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run clippy on library and binaries
run: cargo clippy --workspace --lib --bins -- -D warnings
- name: Run clippy on tests (warnings allowed)
run: cargo clippy --workspace --tests --benches --examples -- -A clippy::unwrap_used -A clippy::expect_used
# Unit tests
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --workspace --lib --bins
# Integration tests (excludes CUDA tests that require nvcc)
integration:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run integration tests
run: cargo test --workspace --test '*' --features cpu
# Doc tests
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check documentation
run: cargo doc --workspace --no-deps
- name: Run doc tests
run: cargo test --workspace --doc
# Build check
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build workspace
run: cargo build --workspace
- name: Build with CPU features
run: cargo build --workspace --features cpu
# Dependency security audit
audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit
run: cargo install --locked cargo-audit
- name: Run cargo audit
# Uses .cargo/audit.toml for ignored advisories (documented transitive deps).
# Unmaintained warnings are informational and do not fail the build.
run: cargo audit
# Feature matrix: test key feature combinations that work without GPU hardware
feature-matrix:
name: Feature Matrix
runs-on: ubuntu-latest
strategy:
matrix:
features:
- "" # no optional features
- "cpu" # CPU backend only
- "enterprise" # enterprise features
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check with features '${{ matrix.features }}'
run: cargo check --workspace --features "${{ matrix.features }}"
# Minimum Supported Rust Version check
msrv:
name: MSRV (1.75)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.75.0
- uses: Swatinem/rust-cache@v2
# Core library + backends honor MSRV 1.75 for downstream users.
# Showcase apps with GUIs (accnet, procint) track latest stable.
- name: Check MSRV (core + backends)
run: cargo check --workspace --exclude ringkernel-accnet --exclude ringkernel-procint