| 1 |
name: CI |
| 2 |
on: [push, pull_request] |
| 3 |
|
| 4 |
permissions: |
| 5 |
contents: read |
| 6 |
|
| 7 |
env: |
| 8 |
RUSTDOCFLAGS: -Dwarnings |
| 9 |
RUSTFLAGS: -Dwarnings |
| 10 |
|
| 11 |
jobs: |
| 12 |
test: |
| 13 |
name: Test |
| 14 |
runs-on: ubuntu-latest |
| 15 |
strategy: |
| 16 |
matrix: |
| 17 |
rust: |
| 18 |
- "1.32" # msrv |
| 19 |
- stable |
| 20 |
- beta |
| 21 |
- nightly |
| 22 |
steps: |
| 23 |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 24 |
- name: Install Rust ${{ matrix.rust }} |
| 25 |
run: | |
| 26 |
rustup self update |
| 27 |
rustup update ${{ matrix.rust }} |
| 28 |
rustup default ${{ matrix.rust }} |
| 29 |
rustc -vV |
| 30 |
- name: Run tests |
| 31 |
run: | |
| 32 |
set -eux |
| 33 |
# Remove `-Dwarnings` at the MSRV since lints may be different |
| 34 |
[ "${{ matrix.rust }}" = "1.32" ] && export RUSTFLAGS="--cfg msrv_test" |
| 35 |
cargo test |
| 36 |
|
| 37 |
rustfmt: |
| 38 |
name: Rustfmt |
| 39 |
runs-on: ubuntu-latest |
| 40 |
steps: |
| 41 |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 42 |
- name: Install Rust Stable |
| 43 |
run: | |
| 44 |
rustup update stable |
| 45 |
rustup default stable |
| 46 |
rustup component add rustfmt |
| 47 |
- name: Run rustfmt |
| 48 |
run: cargo fmt -- --check |