name: CI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache cargo registry
uses: actions/cache@v1
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo index
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }}
- name: Build
uses: actions-rs/cargo@v1
command: build
- uses: isbang/compose-action@v0.1
- name: Run tests
command: test
args: -- --test-threads=1
clippy:
name: clippy (ubuntu-latest, stable)
runs-on: ubuntu-latest
- name: Instal latest stable
toolchain: stable
components: clippy
- name: Cache cargo build
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- name: Check clippy
command: clippy
args: -- -D warnings
fmt:
name: fmt (ubuntu-latest, stable)
components: rustfmt
- name: Check format
command: fmt
args: --all -- --check