CI: cargo +nightly doc with nightly lints #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run tests and validate version | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| # Cargo.toml has "rust-version" (MSRV) 1.31. But, 1.37 is the oldest Alpine docker image. See | |
| # https://hub.docker.com/_/rust/tags?name=alpine&ordering=-last_updated. | |
| # | |
| # rust:1.37-alpine was failing some GitHub's extra checks: | |
| # https://github.com/peter-lyons-kehl/prudent/actions/runs/18773758118/job/53563574851 | |
| # | |
| # Other Rust Alpine images that I've tried and they failed: rust:1.54.0-alpine. | |
| # | |
| # Also, our tests use usize::unchecked_add, which was stabilized in Rust 1.79. | |
| container: rust:1.79-alpine | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: rustup components | |
| shell: sh | |
| run: | | |
| rustup component add clippy rustfmt | |
| rustup install nightly --profile minimal | |
| rustup +nightly component add miri | |
| - name: Clippy, fmt | |
| shell: sh | |
| run: | | |
| cargo clippy | |
| cargo fmt --check | |
| - name: Doc (stable, nightly) | |
| shell: sh | |
| run: | | |
| cargo doc --no-deps --quiet | |
| RUSTDOCFLAGS="--forbid rustdoc::invalid_codeblock_attributes \ | |
| --forbid rustdoc::missing_doc_code_examples \ | |
| -Zcrate-attr=feature(rustdoc_missing_doc_code_examples)" \ | |
| cargo +nightly doc --no-deps --quiet | |
| - name: Tests (debug, release, MIRI) | |
| shell: sh | |
| run: | | |
| cargo test | |
| cargo test --release | |
| cargo +nightly miri test |