name: Check code
on:
workflow_dispatch: {}
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
branches:
- main
jobs:
run-tests:
name: Run tests
runs-on: windows-2022
env:
RUSTFLAGS: '-D warnings'
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install toolchains
run: |
rustup toolchain install stable-x86_64-pc-windows-msvc --profile minimal -t x86_64-pc-windows-msvc -c clippy,rustfmt
rustup toolchain install nightly --profile minimal -c clippy,rustfmt
rustup default stable-x86_64-pc-windows-msvc
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo hack
uses: taiki-e/install-action@cargo-hack
- name: Run tests
run: cargo hack test --each-feature
- name: Run clippy
run: cargo +nightly clippy --no-deps -- -D clippy::pedantic
- name: Check docs
env:
RUSTDOCFLAGS: '-D warnings'
run: cargo +nightly doc --no-deps
- name: Check formatting
run: cargo +nightly fmt --check