on:
push:
paths:
- "**.rs"
- "**.toml"
- Cargo.lock
- .github/**
- PKGBUILD
name: check
jobs:
check:
name: Rust project
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
id: rust-toolchain
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
- uses: actions/cache@v2
with:
path: |
~/.cargo
target/debug/deps
target/debug/build
key: ${{ steps.rust-toolchain.outputs.rustc_hash }}-${{hashFiles('Cargo.lock')}}
- run: cargo fmt --all -- --check
- run: cargo check --all
- run: cargo clippy --all
- run: cargo build --all
- run: cargo test --all