voting-circuits 0.8.0

Governance ZKP circuits (delegation, vote proof, share reveal) for the Zcash shielded-voting protocol.
Documentation
name: Test

on:
  pull_request:
  push:
    branches:
      - main
  schedule:
    - cron: '0 9 * * 0'
  workflow_dispatch:
    inputs:
      run:
        description: Manual test target
        type: choice
        required: true
        default: full-suite
        options:
          - full-suite
          - diagnostics

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

jobs:
  short-tests:
    name: Short tests
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@1.86.0
        with:
          components: rustfmt

      - name: Cache Cargo build artifacts
        uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --all --check

      - name: Run short tests
        run: cargo test --locked

      - name: Run IMT integration tests
        run: cargo test --locked --features unstable-internal-api --test imt_circuit_integration

  full-suite:
    name: Full suite
    if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.run == 'full-suite')
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt

      - name: Cache Cargo build artifacts
        uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --all --check

      - name: Run short tests
        run: cargo test --locked

      - name: Run long tests
        run: cargo test --locked -- --ignored --skip row_budget --skip cost_breakdown

      - name: Run IMT integration tests
        run: cargo test --locked --features unstable-internal-api --test imt_circuit_integration

      - name: Run long IMT integration tests
        run: cargo test --locked --features unstable-internal-api --test imt_circuit_integration -- --ignored --test-threads=1

  diagnostics:
    name: Diagnostics
    if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.run == 'diagnostics')
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt

      - name: Cache Cargo build artifacts
        uses: Swatinem/rust-cache@v2

      - name: Run row-budget diagnostics
        run: cargo test --locked row_budget -- --ignored --nocapture

      - name: Run cost-breakdown diagnostics
        run: cargo test --locked cost_breakdown -- --ignored --nocapture