on:
push:
branches:
- main
pull_request: {}
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust:
- 1.81.0
- stable
- beta
- nightly
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Install cargo-audit
run: cargo install cargo-audit
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Install Clippy (Windows)
if: matrix.os == 'windows-latest' && matrix.rust == '1.81.0'
run: rustup component add --toolchain 1.81.0-x86_64-pc-windows-msvc clippy
- name: Install Clippy (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.rust == '1.81.0'
run: rustup component add --toolchain 1.81.0-x86_64-unknown-linux-gnu clippy
- name: Install Clippy (macOS)
if: matrix.os == 'macos-latest' && matrix.rust == '1.81.0'
run: rustup component add --toolchain 1.81.0-aarch64-apple-darwin clippy
- name: Clippy
if: matrix.rust == '1.81.0'
run: cargo clippy --verbose -- -D warnings
- name: Audit
if : matrix.rust == '1.81.0'
run: cargo audit