Skip to content

Add some CI checks

Add some CI checks #3

Workflow file for this run

name: tests
on:
pull_request:
concurrency:
group: tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MSRV: "1.63"
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
SCCACHE_GHA_ENABLED: "on"
jobs:
lint:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.4
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --workspace --all-targets --all-features
test:
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- os: "ubuntu-latest"
toolchain: "x86_64-unknown-linux-gnu"
name: "Linux GNU"
- os: "macOS-latest"
toolchain: "x86_64-apple-darwin"
name: "macOS"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-msvc"
name: "Windows MSVC"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-gnu"
name: "Windows GNU"
channel:
- "stable"
env:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
targets: ${{ matrix.target.toolchain }}
- uses: mozilla-actions/sccache-action@v0.0.4
- name: cargo test
run: cargo test --workspace --all-features --bins --tests --examples
# Checks correct runtime deps and features are requested by not including dev-dependencies.
check-deps:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.4
- name: cargo check
run: cargo check --workspace --all-features --lib --bins
minimal-crates:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@nightly
- uses: mozilla-actions/sccache-action@v0.0.4
- name: cargo check
run: |
rm -f Cargo.lock
cargo +nightly check -Z minimal-versions --workspace --all-features --lib --bins