name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt --check
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
test:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test
platform-gate:
name: platform primitive gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: no hand-rolled HOME/USERPROFILE lookups
run: |
if grep -rnE --include='*.rs' --exclude-dir=target --exclude-dir=.git 'env::var(_os)?\("(HOME|USERPROFILE)"\)' .; then
echo "Banned: use the repo home-dir helper (dirs::home_dir() or the local throat) instead of raw HOME/USERPROFILE env lookups."
exit 1
fi