racah 0.2.0

Racah-Wigner calculus for compact Lie groups: exact SU(2) recoupling, and runtime Clebsch-Gordan / F- / R-coefficient generation for SU(N), SO(N), and Sp(2N)
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -D warnings

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal --component rustfmt
      - run: cargo fmt --all --check

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal --component clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --all-targets --all-features

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal
      - uses: Swatinem/rust-cache@v2
      # dev-dependency wigner-symbols pulls gmp-mpfr-sys, which builds GMP
      # from source on first run; rust-cache keeps the build cached across runs.
      - run: cargo test --all-features
      - run: cargo test --no-default-features

  # Non-blocking coverage measurement for the README badge. Line coverage is
  # auxiliary here — the golden/coherence guards are the primary correctness
  # gates — so this job never fails the pipeline. It publishes a shields.io
  # endpoint JSON to the `badges` branch, which the README badge reads via
  # raw.githubusercontent.com.
  coverage:
    if: github.ref == 'refs/heads/main' && github.event_name == 'push'
    runs-on: ubuntu-latest
    continue-on-error: true
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal --component llvm-tools-preview
      - uses: Swatinem/rust-cache@v2
      - uses: taiki-e/install-action@cargo-llvm-cov
      # One instrumented test run; both report formats are re-emitted from it.
      - run: cargo llvm-cov --workspace --all-features --no-report
      - run: cargo llvm-cov report --summary-only --json --output-path coverage.json
      - run: cargo llvm-cov report --codecov --output-path codecov.json
      - uses: codecov/codecov-action@v5
        with:
          files: codecov.json
          fail_ci_if_error: false
      - name: Publish badge JSON to badges branch
        run: |
          pct=$(jq -r '.data[0].totals.lines.percent' coverage.json)
          msg=$(printf '%.1f%%' "$pct")
          color=$(awk -v p="$pct" 'BEGIN{print (p<60)?"red":(p<80)?"yellow":"brightgreen"}')
          jq -n --arg m "$msg" --arg c "$color" \
            '{schemaVersion:1,label:"coverage",message:$m,color:$c}' > badge.json
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
          # Single-file branch built from plumbing; history is disposable, force-push.
          blob=$(git hash-object -w badge.json)
          tree=$(printf '100644 blob %s\tbadge.json\n' "$blob" | git mktree)
          commit=$(git commit-tree "$tree" -m "coverage badge: $msg ($GITHUB_SHA)")
          git push -f origin "$commit:refs/heads/badges"

  doc:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal
      - uses: Swatinem/rust-cache@v2
      - run: cargo doc --no-deps --all-features
        env:
          # Same KaTeX header as docs.rs (Cargo.toml [package.metadata.docs.rs]);
          # space-separated flags compose in the one RUSTDOCFLAGS env var.
          RUSTDOCFLAGS: -D warnings --html-in-header doc/katex-header.html