name: CI
on:
pull_request: push:
branches: - main
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
- build: macos
os: macos-latest
- build: windows
os: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install latest stable Rust version
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest stable Rust version
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
clippy_check:
name: Clippy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest stable Rust version
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features