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
# Third-party Actions are pinned to immutable commit SHAs (Aikido supply-chain policy).
name: CI
on:
push:
branches:
pull_request:
branches:
jobs:
validate:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Install Rust 1.97.1
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # pinned action
with:
toolchain: 1.97.1
components: clippy, rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Check for relevant changes
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: changes
with:
filters: |
rust:
- '**/Cargo.toml'
- '**/Cargo.lock'
- 'src/**'
- 'examples/**'
- 'benches/**'
- 'tests/**'
- name: Check formatting
run: cargo fmt --check
- name: Clippy (lint)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --all-features
- name: Test (nextest for speed)
if: steps.changes.outputs.rust == 'true'
run: |
cargo install cargo-nextest --locked
cargo nextest run --all-features --no-fail-fast
- name: Feature matrix (cargo-hack)
if: steps.changes.outputs.rust == 'true'
run: |
cargo install cargo-hack --locked
cargo hack check --feature-powerset --exclude-no-default-features --keep-going
- name: Verify docs are domain-agnostic
run: |
cargo doc --no-deps
! grep -riE 'spikenaut|\bhft\b|\bmining\b|\bcrypto\b|eagle-lander' target/doc/neuromod/
- name: Verify optional sentry feature compiles
if: steps.changes.outputs.rust == 'true'
run: cargo check --features sentry