quipu 0.5.0

Codec criptográfico post-cuántico híbrido con endurecimiento online verificable (VOPRF) y canal visual de glifos.
Documentation
name: CI

# Se activa cuando el proyecto pase a git/GitHub. Mientras tanto, el equivalente
# local es `scripts/audit.sh`.
on:
  push:
    branches: [main, master]
  pull_request:
  schedule:
    # Auditoría semanal de dependencias aunque no haya cambios (nuevas CVEs).
    - cron: "0 6 * * 1"

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test + clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - name: Build
        run: cargo build --all-targets
      - name: Tests
        run: cargo test --all-targets
      - name: Clippy (deny warnings)
        run: cargo clippy --all-targets -- -D warnings
      - name: Tests (slh feature, release — SLH-DSA signing is slow in debug)
        run: cargo test --features slh --release
      - name: Clippy (slh feature, deny warnings)
        run: cargo clippy --features slh --all-targets --release -- -D warnings

  audit:
    name: cargo-audit (RustSec)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Install cargo-audit
        run: cargo install cargo-audit --locked
      - name: Audit dependencies
        run: cargo audit

  security-lab:
    name: security lab (feature-gated)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - name: Isolation — el arma no viaja en el build por defecto
        run: |
          # Ningún módulo NO-lab debe referenciar crate::lab.
          if grep -rn "crate::lab" src --include='*.rs' | grep -v '^src/lab/' | grep -v 'cfg(feature = "lab")'; then
            echo "FALLO: referencia a crate::lab fuera del laboratorio" && exit 1
          fi
          # El build por defecto (el que se publica) no debe compilar el laboratorio.
          cargo build
      - name: Lab tests
        run: cargo test --features lab --lib lab
      - name: Lab tests (streaming forgery)
        run: cargo test --features lab stream_attack
      - name: Lab example
        run: cargo run --example securitylab --features lab
      - name: Clippy (lab, deny warnings)
        run: cargo clippy --features lab --all-targets -- -D warnings
      - name: Lab tests (triple-hybrid forgery, release)
        run: cargo test --features "lab slh" --release forge_triple

  sbom:
    name: SBOM (CycloneDX)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-cyclonedx
        run: cargo install cargo-cyclonedx --locked
      - name: Generate SBOM (JSON)
        run: cargo cyclonedx --format json
      - name: Upload SBOM artifact
        uses: actions/upload-artifact@v4
        with:
          name: sbom
          path: |
            *.cdx.json
            bom.json
          if-no-files-found: error

  vet:
    name: cargo-vet (supply chain)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-vet
        run: cargo install cargo-vet --locked
      - name: Vet dependencies
        run: cargo vet --locked