name: CI
on:
workflow_call:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
MSRV: 1.88.0
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
- name: Test CI scripts
run: python3 -B -m unittest discover -s scripts -p 'test_*.py'
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust ${{ env.MSRV }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Check MSRV
run: cargo check --locked --all-targets --all-features
test:
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Require Git for full integration coverage
run: git --version
- name: Install Python for package validation
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Run tests
run: cargo test --locked --all-targets --all-features
- name: Run tests without Git
if: runner.os != 'Windows'
run: python3 scripts/check_test_environment.py
- name: Build release binary
run: cargo build --locked --release
- name: Test distributed source package
run: python3 scripts/check_source_package.py