name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 with:
toolchain: stable
components: clippy, rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5
- name: Build
run: cargo build
- name: Test
run: cargo test
- name: Format
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings