name: Build
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rust fmt
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
check:
name: Check for warnings
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- 1.51
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: set rust options to fail on warnings
run: echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
- uses: actions-rs/cargo@v1
with:
command: check
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- 1.51
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
with:
command: test