Merge pull request #420 from jagmarques/criteria/420-421-422-corpus-f… #975
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python: ${{ steps.filter.outputs.python }} | |
| typescript: ${{ steps.filter.outputs.typescript }} | |
| verifier: ${{ steps.filter.outputs.verifier }} | |
| actions: ${{ steps.filter.outputs.actions }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| python: | |
| - 'python/**' | |
| - 'conformance/**' | |
| # The shared case tables gate both verifiers, so editing one must run | |
| # the jobs that consume it or the gate could be weakened unseen. | |
| - 'verifier/cross-language-cases.json' | |
| - 'verifier/axis-parity-cases.json' | |
| - 'verifier/anchor-value-cases.json' | |
| - 'verifier/time-edge-cases.json' | |
| - '.github/workflows/ci.yml' | |
| typescript: | |
| - 'typescript/**' | |
| - 'conformance/**' | |
| # The TS verifier parity gate reads the shared conformance corpus, | |
| # so a corpus change must re-run the TS job (not just the Python one). | |
| - 'verifier/conformance-vectors/**' | |
| - 'verifier/cross-language-cases.json' | |
| - 'verifier/axis-parity-cases.json' | |
| - 'verifier/anchor-value-cases.json' | |
| - 'verifier/time-edge-cases.json' | |
| - '.github/workflows/ci.yml' | |
| verifier: | |
| - 'python/src/asqav/verifier/**' | |
| - 'verifier/conformance-vectors/**' | |
| - 'verifier/cross-language-cases.json' | |
| - 'verifier/axis-parity-cases.json' | |
| - 'verifier/anchor-value-cases.json' | |
| - 'verifier/time-edge-cases.json' | |
| # Corpus-freeze tooling and the standalone walkthrough gate the | |
| # corpus here, so editing one must re-run this job. | |
| - 'verifier/check_corpus_lock.sh' | |
| - 'verifier/freeze_corpus_lock.py' | |
| - 'verifier/docs/**' | |
| - '.github/workflows/ci.yml' | |
| actions: | |
| - 'github-action/**' | |
| - 'github-action-risk-acceptance/**' | |
| - '.github/workflows/ci.yml' | |
| python: | |
| needs: changes | |
| if: needs.changes.outputs.python == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install -e "./python[all,dev]" pytest ruff | |
| - run: ruff check python/src | |
| - run: pytest python/tests -v --tb=short --continue-on-collection-errors | |
| typescript: | |
| needs: changes | |
| if: needs.changes.outputs.typescript == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: ['20', '22'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: typescript/package-lock.json | |
| - run: npm ci | |
| working-directory: typescript | |
| - run: npm run lint --if-present | |
| working-directory: typescript | |
| - run: npm test | |
| working-directory: typescript | |
| # Run the release build in CI so a green run guarantees | |
| # npm run build (dts included) compiles. Publish runs the same command. | |
| - run: npm run build | |
| working-directory: typescript | |
| verifier: | |
| needs: changes | |
| if: needs.changes.outputs.verifier == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # dilithium-py is required, not optional: the ML-DSA-65 forgery and | |
| # issuer-binding tests skip without it, so the job would prove nothing. | |
| - run: pip install cryptography "dilithium-py==1.4.0" pytest "ruff==0.15.20" | |
| - run: ruff check python/src/asqav/verifier | |
| # Corpus freeze path B (criterion 420): re-derive every lock pin through | |
| # sha256sum, independent of the hashlib pass in test_corpus_lock.py. | |
| - run: bash verifier/check_corpus_lock.sh | |
| # Criterion 421 walkthrough: jq/sha256sum/openssl verification of the | |
| # published receipt. ubuntu-latest ships OpenSSL 3.0 without ML-DSA, so | |
| # the ML-DSA step is declared document-only; every other step executes | |
| # and asserts its pinned value. | |
| - run: bash verifier/docs/openssl-jq-verify.sh --mldsa-document-only | |
| - run: PYTHONPATH=python/src pytest python/tests/test_oracle.py python/tests/test_verify_receipt.py python/tests/test_verify_receipt_revoked_key.py python/tests/test_verify_receipt_failclean.py python/tests/test_offline_verify.py python/tests/test_cross_language_cases.py python/tests/test_axis_parity_cases.py python/tests/test_anchor_value_cases.py python/tests/test_anchor_forged_value.py python/tests/test_oracle_kid_shared_resolution.py python/tests/test_signing_key_sibling.py python/tests/test_exit_artifact_cli.py python/tests/test_corpus_lock.py python/tests/test_time_edge_vectors.py python/tests/test_standalone_verifier_surface.py -v --tb=short | |
| actions: | |
| needs: changes | |
| if: needs.changes.outputs.actions == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| # Pinned: an unpinned ruff turns this job red on a linter release with no | |
| # code change. ruff 0.16 flags 10 findings here that 0.15 does not. | |
| - run: pip install pytest "ruff==0.15.20" | |
| - run: ruff check github-action github-action-risk-acceptance | |
| - run: pytest github-action github-action-risk-acceptance -v --tb=short | |
| ci-ok: | |
| # Single required status check for branch protection. | |
| # Passes when matrix jobs succeeded OR were skipped (no relevant changes). | |
| needs: [python, typescript, verifier, actions] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| echo "python=${{ needs.python.result }}" | |
| echo "typescript=${{ needs.typescript.result }}" | |
| echo "verifier=${{ needs.verifier.result }}" | |
| echo "actions=${{ needs.actions.result }}" | |
| [[ "${{ needs.python.result }}" =~ ^(success|skipped)$ ]] || exit 1 | |
| [[ "${{ needs.typescript.result }}" =~ ^(success|skipped)$ ]] || exit 1 | |
| [[ "${{ needs.verifier.result }}" =~ ^(success|skipped)$ ]] || exit 1 | |
| [[ "${{ needs.actions.result }}" =~ ^(success|skipped)$ ]] || exit 1 |