on:
push:
pull_request:
schedule:
- cron: "* * 15 * *"
name: Check rustfmt, run tests, clippy & dependency audit
jobs:
test:
name: Run Test Suite on Linux, Windows & MacOs
strategy:
matrix:
rust:
- stable
- nightly
platform:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.platform }}
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
fmt:
name: Check if Code is RustFmt'ed
strategy:
matrix:
rust:
- stable
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
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
clippy:
name: Run Clippy on ubuntu with stable toolchain & only log warnings (no failures)
strategy:
matrix:
rust:
- stable
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --
security_audit:
name: Security audit the cargo dependencies on ubuntu with stable toolchain
strategy:
matrix:
rust:
- stable
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}