name: Tests
on: [push, pull_request]
concurrency:
group: testing_${{ github.head_ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
strategy:
matrix:
include:
- name: Ubuntu 20.04 - Release
runner: ubuntu-20.04
cargo_profile: --release
- name: Ubuntu 20.04 - Debug
runner: ubuntu-20.04
cargo_profile:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.name }}
- name: Install cargo-hack
run: cargo install cargo-hack --version 0.5.8
- name: Check `cargo fmt` was run
run: cargo fmt --all -- --check
- name: Ensure that all crates compile and have no warnings under every possible combination of features
run: cargo hack --feature-powerset clippy --all-targets --locked ${{ matrix.cargo_profile }} -- -D warnings
- name: Ensure that tests pass
run: cargo hack --feature-powerset test ${{ matrix.cargo_profile }} -- --include-ignored --show-output
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi