build(deps): bump the github-actions group across 1 directory with 3 … #91
Workflow file for this run
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: Python binding | |
| on: | |
| push: | |
| paths: | |
| - "bindings/python/**" | |
| - "impl/rust/pqf-reader/**" | |
| - ".github/workflows/python-binding.yml" | |
| pull_request: | |
| paths: | |
| - "bindings/python/**" | |
| - "impl/rust/pqf-reader/**" | |
| - ".github/workflows/python-binding.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build + smoke (${{ matrix.os }} / py${{ matrix.python }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python: ["3.10", "3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install Rust (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| bindings/python/target | |
| impl/rust/pqf-reader/target | |
| key: ${{ runner.os }}-py${{ matrix.python }}-cargo-${{ hashFiles('bindings/python/Cargo.toml', 'impl/rust/pqf-reader/Cargo.toml') }} | |
| - name: Install maturin | |
| run: python -m pip install --upgrade pip maturin | |
| - name: Build wheel | |
| working-directory: bindings/python | |
| run: maturin build --release --out dist | |
| - name: Install wheel | |
| working-directory: bindings/python | |
| shell: bash | |
| run: | | |
| WHEEL=$(ls dist/*.whl | head -1) | |
| python -m pip install "$WHEEL" | |
| - name: Smoke test (import + parse a vector) | |
| working-directory: bindings/python | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import pqf, json, pathlib | |
| repo = pathlib.Path("../..").resolve() | |
| # Pick the first positive test vector. | |
| path = repo / "test-vectors" / "v1" / "cases" / "TV-001.pqf" | |
| blob = path.read_bytes() | |
| header = pqf.parse_header(blob) | |
| assert header["alg"]["kem"] == "x25519+ml-kem-768", header | |
| assert header["alg"]["combiner"] == "x-wing" | |
| assert len(header["recipients"]) >= 1 | |
| print("OK: pqf.parse_header round-trips on TV-001") | |
| # Now decrypt with the manifest identity. | |
| manifest = json.loads((repo / "test-vectors" / "v1" / "manifest.json").read_text()) | |
| ident_a = manifest["Identities"][0] | |
| identity = pqf.Identity.from_manifest( | |
| ident_a["Id"], | |
| ident_a["PublicKey"], | |
| ident_a["X25519PrivateKey"], | |
| ident_a["MlKem768PrivateKey"], | |
| ) | |
| plaintext = pqf.decrypt(blob, identity) | |
| assert len(plaintext) > 0 | |
| print(f"OK: pqf.decrypt produced {len(plaintext)} bytes") | |
| PY |