Refactor CI workflow for Python script execution #12
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: GDI CI — Schema Validation and Tests | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| jobs: | |
| validate-schema: | |
| name: Validate GDR Schema and Example | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install jsonschema | |
| run: pip install jsonschema | |
| - name: Validate gdr.example.json against gdr.schema.json | |
| run: | | |
| python3 - <<'PYEOF' | |
| import json | |
| import jsonschema | |
| with open("schema/gdr.schema.json") as f: | |
| schema = json.load(f) | |
| with open("schema/gdr.example.json") as f: | |
| example = json.load(f) | |
| jsonschema.validate(instance=example, schema=schema) | |
| print("✓ gdr.example.json validates against gdr.schema.json") | |
| PYEOF | |
| test-gate-classifier: | |
| name: Gate Classifier Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Run gate classifier tests | |
| working-directory: reference-implementation/gate-classifier | |
| run: | | |
| python test_gate_classifier.py | |
| echo "✓ Gate classifier tests passed" | |
| interop-check: | |
| name: Interoperability Driver Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install jsonschema cryptography | |
| - name: Verify interop driver runs | |
| working-directory: examples/testvectors-interop | |
| run: | | |
| python3 gdi_driver.py || true | |
| echo "✓ Interoperability driver executed" |