name: CI
permissions:
contents: read
concurrency:
group: >
ci-${{ github.workflow }}-${{
github.event_name == 'pull_request' &&
github.event.pull_request.number ||
github.ref
}}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_NEXTEST_VERSION: "0.9.137"
DPRINT_VERSION: "0.54.0"
JUST_VERSION: "1.51.0"
RUMDL_VERSION: "0.2.6"
TAPLO_VERSION: "0.10.0"
TYPOS_VERSION: "1.47.1"
UV_VERSION: "0.11.18"
ZIZMOR_VERSION: "1.25.2"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Disable Git autocrlf on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 with:
target: ${{ matrix.target }}
cache: true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Sync Python tooling
run: uv sync --locked --group dev
- name: Install just
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: just@${{ env.JUST_VERSION }}
- name: Install dprint
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: dprint@${{ env.DPRINT_VERSION }}
- name: Install rumdl
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: rumdl@${{ env.RUMDL_VERSION }}
- name: Install taplo
id: install-taplo
continue-on-error: ${{ matrix.os == 'windows-latest' }}
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: taplo-cli@${{ env.TAPLO_VERSION }}
- name: Install taplo on Windows after cached install failure
if: matrix.os == 'windows-latest' && steps.install-taplo.outcome == 'failure'
shell: pwsh
run: cargo install --locked taplo-cli --version $env:TAPLO_VERSION
- name: Install typos
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: typos-cli@${{ env.TYPOS_VERSION }}
- name: Install zizmor
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: zizmor@${{ env.ZIZMOR_VERSION }}
- name: Install cargo-nextest
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 with:
tool: cargo-nextest@${{ env.CARGO_NEXTEST_VERSION }}
- name: Run CI checks
run: just ci