name: Test
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
main:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v4
- run: git reset --hard
- run: rustup component add clippy rustfmt
- uses: Swatinem/rust-cache@v2
- run: mise run ci
- run: mise run cover:rust
if: github.ref_name == 'main'
- uses: powerman/.github/.github/actions/coverage-badge@main
if: github.ref_name == 'main'
with:
total_cmd: "mise run -q cover:rust:total"
native:
strategy:
matrix:
include:
- {os: ubuntu-24.04-arm} - {os: macos-15-intel} - {os: macos-latest} runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v4
with:
install_args: rust
- run: git reset --hard
- run: rustup component add clippy rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace
test:
needs: [main, native]
runs-on: ubuntu-latest
if: always()
steps:
- name: Fail if any dependency failed, cancelled or skipped
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
run: exit 1