name: CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- id: generate
uses: mmastrac/mmm-matrix@v1
with:
input: |
rust-toolchain: stable
job: [test]
label:
linux:
os: ubuntu-latest
macos:
os: macos-latest
windows:
os: windows-latest
config: |
github: ${{ toJSON(github) }}
test:
name: ${{ matrix.label }} / ${{ matrix.job }} (${{ matrix.rust-toolchain }})
runs-on: ${{ matrix.os }}
needs: generate-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain (${{ matrix.rust-toolchain }})
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust-toolchain }}
- name: Install wget (Windows)
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
choco install -y wget
wget --version
- name: Install pwsh (Linux, best-effort)
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
set -euxo pipefail
sudo apt-get update
# Ubuntu images may already include pwsh; if not, try installing via apt.
# If the package isn't available, continue without failing the job.
sudo apt-get install -y powershell || true
command -v pwsh >/dev/null 2>&1 && pwsh -NoProfile -NonInteractive -Command '$PSVersionTable.PSVersion' || true
- name: Run tests (default features)
shell: bash
run: cargo test
- name: Run tests (all features)
shell: bash
run: cargo test --all-features
- name: Run tests (no features)
shell: bash
run: cargo test --no-default-features