Skip to content

Merge branch 'main' into johannes/ci-mutations #14

Merge branch 'main' into johannes/ci-mutations

Merge branch 'main' into johannes/ci-mutations #14

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
style:
name: Check style
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- name: Cargo fmt
run: cargo fmt --all -- --check
typos:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check the spelling of the files in our repo
uses: crate-ci/typos@master
clippy:
name: Run clippy
needs: [style]
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
test:
name: ${{ matrix.target.name }} ${{ matrix.channel }}
needs: [clippy]
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
target: [
{ "os": "ubuntu-latest", "toolchain": "x86_64-unknown-linux-gnu", "name": "Linux GNU" },
{ "os": "macos-13", "toolchain": "x86_64-apple-darwin ", "name": "macOS x86" },
{ "os": "macos-latest", "toolchain": "aarch64-apple-darwin", "name": "macOS arm" },
{ "os": "windows-latest", "toolchain": "x86_64-pc-windows-msvc", "name": "Windows MSVC" },
]
channel: [stable, beta, nightly]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ format('{0}-{1}', matrix.channel, matrix.target.toolchain) }}
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test --all-features
mutants-incremental:
name: Mutation tests (incremental)
needs: [clippy]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Relative diff
run: |
git branch -av
git diff origin/${{ github.base_ref }}.. | tee git.diff
- uses: Swatinem/rust-cache@v2
- name: Install cargo-mutants
uses: taiki-e/install-action@v2
with:
tool: cargo-mutants
- name: Test
run: cargo mutants -vV --no-shuffle --in-place --in-diff git.diff
- name: Archive mutants.out
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-incremental.out
path: mutants.out
mutants-full:
name: Mutation tests (full)
needs: [clippy]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- name: Install cargo-mutants
uses: taiki-e/install-action@v2
with:
tool: cargo-mutants
- name: Test
run: cargo mutants -vV --no-shuffle --in-place
- name: Archive mutants.out
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-full.out
path: mutants.out