There was no CI of any kind — no workflows directory at all — despite a full release pipeline (release.toml, cliff.toml, a maintained CHANGELOG, three tagged releases). The workflow covers the feature combinations that actually have distinct behaviour, including a release-profile job: `debug_assert!` is compiled out there, which is exactly where the validation this branch added has to hold, and a debug-only suite would never have seen it. Determinism is checked at RAYON_NUM_THREADS of 1, 2, 4 and 8. The Justfile gains test/lint/fmt/determinism recipes so the same checks run locally with one command, and `just ci` runs the lot. `Cargo.toml` had only name, version and edition, so `cargo publish` would have been rejected. Added description, repository, readme, keywords, categories, exclude, and `rust-version = "1.85"` — the edition-2024 floor, now verified by a CI job. Two let-chains introduced earlier on this branch would have pushed that to 1.88; they are rewritten to keep the floor where it was. `src/lib.rs` had no `//!` header at all, so the docs.rs landing page would have been a bare symbol list — conspicuous given every other module has one. It now explains what Through Time does differently, and carries three runnable examples (which `cargo test --doc` checks, where previously there was nothing to check), including the draw/p_draw interaction that is the easiest way to get an error out of this crate. `cargo publish --dry-run` now packages and verifies cleanly. The only remaining blocker is `license`, which is yours to choose — noted as a TODO in the manifest rather than picked unilaterally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnsaJg74eNSva3PJjK2eej
88 lines
2.5 KiB
YAML
88 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: -D warnings
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# The build most consumers get.
|
|
- name: default
|
|
features: ""
|
|
profile: ""
|
|
# Most numerical goldens need `approx` for assert_ulps_eq.
|
|
- name: approx
|
|
features: "--features approx"
|
|
profile: ""
|
|
# The parallel path, including tests/determinism.rs.
|
|
- name: rayon
|
|
features: "--features approx,rayon"
|
|
profile: ""
|
|
# Critical: debug_assert! is compiled out here, which is where the
|
|
# tie/p_draw and score_sigma validation actually has to hold.
|
|
- name: release
|
|
features: "--features approx"
|
|
profile: "--release"
|
|
name: test (${{ matrix.name }})
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo test ${{ matrix.profile }} ${{ matrix.features }}
|
|
- run: cargo test ${{ matrix.profile }} ${{ matrix.features }} --doc
|
|
|
|
determinism:
|
|
name: determinism across thread counts
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
# Posteriors must be bit-identical regardless of how many rayon workers
|
|
# run the color-group sweep.
|
|
- run: |
|
|
for threads in 1 2 4 8; do
|
|
echo "== RAYON_NUM_THREADS=$threads =="
|
|
RAYON_NUM_THREADS=$threads cargo test --release \
|
|
--features approx,rayon --test determinism
|
|
done
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# rustfmt.toml uses nightly-only options (imports_granularity).
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo +nightly fmt --check
|
|
|
|
msrv:
|
|
name: minimum supported Rust version
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@1.85.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo check --all-targets --features approx,rayon
|