name: Test
on:
push:
workflow_dispatch:
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [1.50.0]
experimental: [false]
include:
- os: ubuntu-latest
toolchain: stable
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
override: true
- name: Check Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Clippy
uses: actions-rs/clippy-check@v1
if: ${{ contains(matrix.os, 'ubuntu') && !matrix.experimental }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings
name: Clippy
- name: Clippy CLI only
uses: actions-rs/cargo@v1
if: ${{ !(contains(matrix.os, 'ubuntu') && !matrix.experimental) }}
with:
command: clippy
args: --all-targets --all-features -- -D warnings
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Doc
uses: actions-rs/cargo@v1
with:
command: doc
- name: Test
uses: actions-rs/cargo@v1
if: ${{ contains(matrix.os, 'ubuntu') }}
with:
command: test