everett 0.1.2

A clean, zero-dependency statevector quantum simulator.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  check:
    name: nix flake check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: DeterminateSystems/nix-installer-action@v22
      # GitHub-Actions-backed nix store cache; needs no external service or auth.
      - uses: nix-community/cache-nix-action@v7
        with:
          primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
          restore-prefixes-first-match: nix-${{ runner.os }}-
      # no --all-systems: the runner is x86_64-linux and cannot build the
      # toolchain for other platforms (the fenix channel drv is per-system).
      - run: nix flake check

  miri:
    name: miri
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: DeterminateSystems/nix-installer-action@v22
      - uses: nix-community/cache-nix-action@v7
        with:
          primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
          restore-prefixes-first-match: nix-${{ runner.os }}-
      - run: >
          nix develop .#miri --command
          env MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-tree-borrows"
          cargo miri test miri_

  kani:
    name: kani
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: model-checking/kani-github-action@v1

  release-check:
    name: release check
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags/v')
    steps:
      - uses: actions/checkout@v5
      - uses: DeterminateSystems/nix-installer-action@v22
      - uses: nix-community/cache-nix-action@v7
        with:
          primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
          restore-prefixes-first-match: nix-${{ runner.os }}-
      - run: nix develop --command cargo publish --dry-run

  coverage:
    name: coverage
    runs-on: ubuntu-latest
    needs: check
    steps:
      - uses: actions/checkout@v5
      - uses: DeterminateSystems/nix-installer-action@v22
      - uses: nix-community/cache-nix-action@v7
        with:
          primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
          restore-prefixes-first-match: nix-${{ runner.os }}-
      - name: cargo llvm-cov
        run: nix develop --command cargo llvm-cov --all-features --lcov --output-path lcov.info
      # uploading is best-effort: a missing CODECOV_TOKEN (or codecov outage)
      # should not fail the build, since coverage was still generated above.
      - uses: codecov/codecov-action@v5
        continue-on-error: true
        with:
          files: lcov.info
          fail_ci_if_error: false
          token: ${{ secrets.CODECOV_TOKEN }}