name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta, nightly]
continue-on-error: ${{ matrix.rust != 'stable' }}
steps:
- uses: actions/checkout@v2
name: Checkout
- uses: actions-rs/toolchain@v1
name: Install Rust Toolchain
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
name: Compile
with:
command: build
- uses: actions-rs/cargo@v1
name: Run Tests
with:
command: test
args: --all --locked --verbose
- uses: actions-rs/cargo@v1
name: Check Code Formatting
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
name: Lints
with:
command: clippy
args: --all-targets -- -D warnings