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
name: CI
on:
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: rustup update stable
- run: rustup default stable
- run: cargo check --all --all-targets
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: rustup update stable
- run: rustup default stable
# `--examples` replaces the default target set, so the full
# suite must be selected explicitly; `--doc` cannot be combined
# with other target selectors.
- run: cargo test --all --lib --bins --tests --examples
- run: cargo test --doc
# `cargo test --examples` builds each example's binary but does
# not execute its `main()` (no example carries `#[test]`), so the
# run-time asserts inside each example never run under
# `cargo test`. Invoke each explicitly so a broken assertion (or
# a broken invariant an example demonstrates) fails CI.
- name: Passing examples must exit 0
run: |
cargo run --example basics
cargo run --example search_space
cargo run --example stateful
# The reproduce example demonstrates a failure and exits
# non-zero by design; verify that expectation.
- name: Reproduce example must fail
run: |
set +e
cargo run --example reproduce > /dev/null 2>&1
status=$?
set -e
test "$status" -eq 1
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Verify the `rust-version` declared in the published crate's
# Cargo.toml still builds. Scope the build to the noprop package
# only (no `--all`): benchmark is `publish = false` and its
# transitive dependencies' MSRV is not part of this crate's
# contract, so failing on them would be noise.
- run: rustup toolchain install 1.88 --profile minimal
- run: rustup default 1.88
- run: cargo build --all-targets
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: rustup update stable
- run: rustup default stable
- run: rustup component add rustfmt clippy
- run: cargo fmt --all -- --check
- run: cargo clippy --all --all-targets -- -D warnings
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: rustup update stable
- run: rustup default stable
- env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps