Check docs in QA, modernise lints #37
This file contains 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: "Pre-merge Quality-Control" | |
on: | |
push: | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: "Test" | |
strategy: | |
matrix: | |
rust-toolchain: ['stable', 'nightly'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install rust | |
id: rust-install | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target/ | |
key: ${{ runner.os }}-${{ steps.rust-install.outputs.cachekey }}-cargo | |
- name: Run testsuite | |
env: | |
RUSTFLAGS: -D warnings | |
run: | | |
cargo +${{steps.rust-install.outputs.name}} test | |
cargo +${{steps.rust-install.outputs.name}} test --all-features | |
qc: | |
runs-on: ubuntu-latest | |
name: "Quality Control" | |
strategy: | |
matrix: | |
rust-toolchain: ['stable', 'nightly'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install rust | |
id: rust-install | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
components: rustfmt, clippy | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target/ | |
key: ${{ runner.os }}-${{ steps.rust-install.outputs.cachekey }}-cargo | |
- name: Check formatting | |
run: | | |
cargo +${{steps.rust-install.outputs.name}} fmt --check | |
- name: Consult Clippy | |
run: | | |
cargo +${{steps.rust-install.outputs.name}} clippy -- -D warnings | |
cargo +${{steps.rust-install.outputs.name}} clippy --all-features -- -D warnings | |
- name: Check docs | |
run: | | |
cargo +${{steps.rust-install.outputs.name}} rustdoc -- -D warnings | |
bench: | |
runs-on: ubuntu-latest | |
name: "Benchmarks" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install rust | |
id: rust-install | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
# We deliberately use a separate cache for this job, so that we can | |
# get consistent comparisons with previous runs, without other jobs' | |
# caching possibly squashing that | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target/ | |
key: ${{ runner.os }}-${{ steps.rust-install.outputs.cachekey }}-cargo-criterion | |
- name: Measure | |
run: | | |
cargo bench |