name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-check:
name: Build and Check
strategy:
matrix:
platform:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- name: Setup Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check
uses: actions-rs/clippy-check@v1
with:
name: clippy-${{ matrix.platform }}
token: ${{ secrets.GITHUB_TOKEN }}
args: |
--all-features --verbose -- -Z macro-backtrace
-W clippy::absurd_extreme_comparisons
-W clippy::erasing_op
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Docs
run: cargo doc --verbose