name: Rust
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --all-targets
- name: Run tests
run: cargo test --all-targets
- name: Run tests for unsafe configuration (default)
run: cargo test --all-targets --features unsafe-opt
- name: Run tests for no-unsafe configuration
run: cargo test --all-targets --no-default-features
- name: Clippy
run: cargo clippy --all-targets -- -D warnings -D clippy::all -D clippy::cargo
- name: Check for correct formatting
run: cargo fmt -- --check --files-with-diff
- name: Cargo audit
run: bash -c 'which cargo-audit || cargo install cargo-audit; cargo audit --deny-warnings'