name: Main
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: check
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: cargo clippy
run: cargo clippy --all-features -- --deny "warnings"
- name: cargo fmt
run: cargo fmt --all --check
- name: cargo test
run: cargo test
- name: cargo doc
run: cargo doc --no-deps
env:
RUSTDOCFLAGS: '-D warnings'
- name: cargo build
run: cargo build --release