name: Build and Test
on:
pull_request:
push:
branches:
- main
env:
RUSTFLAGS: -Dwarnings
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
components: rustfmt
- name: tests
run: cargo test
- name: fmt
run: cargo fmt -- --check
if: matrix.rust == 'stable'