name: Test
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
include:
- build: pinned
os: ubuntu-22.04
rust: 1.66.1
features: ''
- build: stable
os: ubuntu-22.04
rust: stable
features: ''
- build: nightly
os: ubuntu-22.04
rust: nightly
features: 'unstable'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
components: 'clippy, rustfmt'
- name: Formatting
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --features '${{ matrix.features }}' -- -D warnings
- name: Build
run: cargo build --verbose --features '${{ matrix.features }}'
- name: Build fuzzer
run: cargo build
working-directory: fuzz
- name: Build examples
run: cargo build --examples --features '${{ matrix.features }}'
- name: Test
run: cargo test --features '${{ matrix.features }}'
- name: Test nopanic
run: cargo test --release --features _nopanic test_no_panic
- name: Docs
run: cargo doc
- name: Install cargo-tarpaulin
uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin@0.25.0
- name: cargo-tarpaulin
run: |
cargo tarpaulin \
--out html \
--output-dir target/tarpaulin \
--engine llvm \
--features '${{ matrix.features }}' \
--fail-under 100
- name: Upload coverage
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: tarpaulin-report-${{ matrix.build }}
path: target/tarpaulin/tarpaulin-report.html
- name: Install Miri
if: ${{ matrix.rust == 'nightly' }}
run: |
rustup component add miri
cargo miri setup --features '${{ matrix.features }}'
- name: Test with Miri
if: ${{ matrix.rust == 'nightly' }}
run: cargo miri test
env:
MIRIFLAGS: '-Zmiri-symbolic-alignment-check'