on:
push:
branches: [ main, auto, canary ]
pull_request:
branches:
- main
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- name: Lint (clippy)
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets
- name: Lint (rustfmt)
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
rust-version: [ stable ]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
override: true
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- name: Build all targets with all features
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --all-features
- name: Test with cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --workspace
- name: Install nextest from crates.io
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-nextest
- name: Test with nextest from crates.io
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --all-features