criterion2 3.0.3

Statistics-driven micro-benchmarking library
name: CI

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
      - "renovate/**"

jobs:
  ci:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust:
          - stable
          - 1.70.0 # MSRV
          - nightly

    steps:
      - uses: taiki-e/checkout-action@v1

      - uses: dtolnay/rust-toolchain@master
        name: Setup rust toolchain
        with:
          toolchain: ${{ matrix.rust }}
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2
        with:
          save-if: ${{ github.ref_name == 'main' }}

      - name: Build with stable features
        run: cargo build --features stable

      - name: Build with unstable features
        if: ${{ matrix.rust == 'nightly' }}
        run: cargo build --all-features

      - name: Build with minimal features
        run: cargo build --no-default-features

      - name: Test with stable features
        run: cargo test --features stable

      - name: Test with minimal features
        run: cargo test --no-default-features

      - name: Check codspeed
        run: cargo check --features codspeed

      - name: Check for non-standard formatting
        if: ${{ matrix.rust == 'stable' }}
        run: cargo fmt --all -- --check

      - name: Check for clippy hints
        if: ${{ matrix.rust == 'stable' }}
        run: cargo clippy --workspace --all-targets -- -D warnings

      # This fails on 1.64, but works on 1.66 and later.
      # https://github.com/rust-lang/rust/issues/103306
      - name: Test run targeting WASI
        if: false # ${{ matrix.rust == 'stable' }}
        run: |
          curl https://wasmtime.dev/install.sh -sSf | bash
          source ~/.bashrc
          export PATH=$HOME/.wasmtime/bin/:$PATH
          cargo install cargo-wasi
          cargo wasi bench --no-default-features -- --test -- # hack to eliminate the `--bench` argument pass in from `cargo wasi`

  nextest-compat:
    name: Check compatibility with nextest
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable

    steps:
      - uses: taiki-e/checkout-action@v1

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2
        with:
          shared-key: test
          save-if: ${{ github.ref_name == 'main' }}

      - uses: taiki-e/install-action@nextest

      - run: ci/nextest-compat.sh

  unused-deps:
    name: Check Unused Dependencies
    runs-on: ubuntu-latest
    steps:
      - uses: taiki-e/checkout-action@v1
      - uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
        with:
          restore-cache: false
          tools: cargo-shear@1
      - run: cargo shear