name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
toolchain:
- 1.54.0
- stable
- nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: rustfmt, clippy
- name: Build
run: cargo build --verbose --examples
- name: Run tests
run: cargo test --verbose
fmt:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Format code
run: cargo fmt --all -- --check
clippy:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Clippy
run: cargo clippy -- --deny "warnings"