name: Rust
on:
push:
branches:
- '**' pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [stable, nightly]
features: ["--", "--all-features"]
exclude:
- rust: stable
features: "--all-features"
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
components: rustfmt
- name: Build
run: cargo build --verbose ${{ matrix.features }}
- name: Run tests
run: cargo test --verbose
- name: Check formatting
if: ${{ matrix.rust == 'nightly' }}
run: cargo fmt --check