width-search 0.1.0

Width-based search: novelty tables, Iterated Width (IW), and Best-First Width Search (BFWS)
Documentation
# Keep in sync with `task ci` in the Taskfile. Job `name:`s are the required status checks.
name: CI

on:
  push:
    branches: [main]
  pull_request:
  merge_group:

permissions: {}

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
  CARGO_TERM_COLOR: always
  NEXTEST_NO_TESTS: warn

jobs:
  branch:
    name: branch name
    # Runs on PRs and merge queues (detached HEAD passes) so it can be a required check.
    if: github.event_name != 'push'
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      # Set BRANCH_FLOW to gitflow for Git Flow repositories (same value as in the Taskfile).
      - run: sh scripts/check-branch.sh "$HEAD_REF" github
        env:
          HEAD_REF: ${{ github.head_ref }}

  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable
        with:
          toolchain: stable
          components: rustfmt
      - run: cargo fmt --all --check

  clippy:
    name: clippy
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable
        with:
          toolchain: stable
          components: clippy
      - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
      - run: cargo clippy --workspace --all-targets --all-features -- -D warnings

  style:
    name: style (separators, README links, typos)
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: No `// ----` separator comments
        run: "! grep -rnE --include='*.rs' --exclude-dir=target --exclude-dir=.git '^[[:space:]]*//+[[:space:]]*[-=*#~_/]{4,}' ."
      - name: Absolute URLs in README files
        run: "! grep -rnoE --include='README.md' --exclude-dir=target --exclude-dir=.git '(\\]\\(|src=\")[^)\"]*' . | grep -vE ':(\\]\\(|src=\")(https?://|#|mailto:)'"
      - name: Typos
        uses: crate-ci/typos@276087d9a4f06398b3e04825487805e2d7375888 # v1.52.2

  doc:
    name: rustdoc
    runs-on: ubuntu-latest
    permissions:
      contents: read
    env:
      RUSTDOCFLAGS: -D warnings
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
      - run: cargo doc --workspace --all-features --no-deps --document-private-items

  test:
    name: test
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
      - uses: taiki-e/install-action@75a7c0f87bd666af3cdb75c5b9e9d03ab6044e6f # v2.90.6
        with:
          tool: cargo-nextest
      - run: cargo nextest run --workspace --all-features
      - run: cargo test --workspace --all-features --doc

  coverage:
    name: coverage
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable
        with:
          toolchain: stable
          components: llvm-tools-preview
      - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
      - uses: taiki-e/install-action@75a7c0f87bd666af3cdb75c5b9e9d03ab6044e6f # v2.90.6
        with:
          tool: cargo-llvm-cov,cargo-nextest
      - run: cargo llvm-cov nextest --workspace --all-features --lcov --output-path lcov.info
      - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
        with:
          files: lcov.info
          fail_ci_if_error: true
          # OIDC everywhere except fork PRs, which get no id-token and upload tokenless instead.
          use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}


  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: EmbarkStudios/cargo-deny-action@17aeb3c839e42274e2b8adf721c8c65edfdc74dd # v2.1.3
        with:
          command: check
          arguments: --all-features


  msrv:
    name: MSRV
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable
        with:
          toolchain: stable
      - uses: taiki-e/install-action@75a7c0f87bd666af3cdb75c5b9e9d03ab6044e6f # v2.90.6
        with:
          tool: cargo-hack
      - run: cargo hack check --rust-version --workspace --all-targets --ignore-private

  fuzz:
    name: fuzz targets build
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: dtolnay/rust-toolchain@6a52aad76a94a5fbc50d567bb5be24419801c1fb # nightly
        with:
          toolchain: nightly
          components: rustfmt, clippy
      - uses: taiki-e/install-action@75a7c0f87bd666af3cdb75c5b9e9d03ab6044e6f # v2.90.6
        with:
          tool: cargo-fuzz
      # The prebuilt cargo-fuzz is a musl binary and defaults to the musl target, which
      # needs a musl C++ compiler for libfuzzer; build for the runner's gnu triple instead.
      - run: cargo +nightly fuzz build --target x86_64-unknown-linux-gnu
        working-directory: fuzz
      - run: cargo fmt --all --check && cargo +nightly clippy --all-targets -- -D warnings
        working-directory: fuzz