ci: set the default Rust to what we want to test #98
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: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
msrv: | |
strategy: | |
matrix: | |
rust: | |
- version: stable | |
command: test | |
args: "" | |
- version: 1.48.0 | |
command: check | |
args: "--locked" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install Rust | |
run: | | |
rustup toolchain install ${{ matrix.rust.version }} --profile minimal --allow-downgrade | |
rustup default ${{ matrix.rust.version }} | |
- run: cp Cargo.lock.msrv Cargo.lock | |
if: ${{ matrix.rust.version}} == 1.48.0 | |
- name: cargo check/test | |
run: | | |
cargo --version | |
cargo ${{ matrix.rust.command }} ${{ matrix.rust.args }} | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install Rust | |
run: rustup toolchain install stable --profile minimal --component rustfmt,clippy --allow-downgrade | |
- name: cargo fmt | |
run: cargo fmt --check | |
- name: cargo clippy | |
run: cargo clippy --all-features -- --deny warnings | |
- name: install tarpaulin | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: cargo-tarpaulin | |
- name: cargo tarpaulin | |
run: cargo tarpaulin --engine llvm --follow-exec --post-test-delay 10 | |
bench: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install Rust | |
run: rustup toolchain install nightly --profile minimal | |
- name: cargo bench | |
run: cargo +nightly bench --all-features |