name: CI
permissions:
contents: write
on:
push:
branches: ["main", "dev"]
pull_request:
branches: ["main", "dev"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Test workspace
run: cargo test --workspace
- name: Test main crate (no macros)
run: cargo test -p reproducible --no-default-features
- name: Make docs
run: cargo doc --workspace --no-deps
format:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format code
if: github.event_name == 'push'
run: |
BRANCH=$(echo "${{ github.ref }}" | sed 's|refs/heads/||')
cargo fmt --all
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add .
git diff --cached --quiet || git commit -m "FMT: CI cargo fmt"
git pull --rebase origin "$BRANCH"
git push