Skip to content

Renamed frontend_with_tests.rs to frontend_with_compile_fail_tests.rs #84

Renamed frontend_with_tests.rs to frontend_with_compile_fail_tests.rs

Renamed frontend_with_tests.rs to frontend_with_compile_fail_tests.rs #84

Workflow file for this run

name: Tests, doc tests, MIRI, violations coverage
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.
#
# However, with Rust 1.88.0 or older, we were getting false positive errors from `cargo test`,
# reporting constants in doctests as unused, even though they were used. That's why we need at
# least 1.89.
container: rust:1.89.0-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
# violations_coverage/verify_error_messages uses trybuild, which uses Serde (a proc
# macro), which needs to be run as a dynamic library, so it needs musl-dev
apk add --no-cache musl-dev
- name: Clippy, fmt
shell: sh
run: |
cargo clippy
cargo fmt --check
cd violations_coverage/in_crate
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, verify_error_messages=trybuild)
shell: sh
run: |
cargo test
# We need "cargo +nightly test" to validate error numbers. To locate them, search for
# "compile_fail,E" in src/lib.rs.
cargo +nightly test
cargo test --release
cargo +nightly miri test
cd violations_coverage/verify_error_messages
cargo test
cargo fmt --check