name: CI
on:
push:
branches:
- "*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: $HOME/.cargo
key: cargo-${{ hashFiles('Cargo.lock') }}
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Check
uses: actions-rs/cargo@v1
with:
command: check