name: Cargo tests
on:
push:
branches:
- main
pull_request:
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
cargo-test-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
- "--all-features"
- "--no-default-features --lib"
env:
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.features }}
- name: Run tests
run: cargo test ${{matrix.features}}
cargo-test-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
features:
- "--all-features"
- "--no-default-features --lib"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Cargo build cache
uses: actions/cache@v2
with:
path: |
C:\Users\runneradmin\.cargo\registry
C:\Users\runneradmin\.cargo\git
target
key: ${{ runner.os }}-cargo
- name: Run normal tests
shell: powershell
run: cargo test ${{matrix.features}}
cargo-test-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
features:
- "--all-features"
- "--no-default-features --lib"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run tests
run: cargo test ${{matrix.features}}