Skip to content

feat(PLT-1735): golden vector parity — Python side #15

feat(PLT-1735): golden vector parity — Python side

feat(PLT-1735): golden vector parity — Python side #15

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --dev --python ${{ matrix.python-version }}
- name: Run tests
run: uv run --python ${{ matrix.python-version }} pytest tests/ -v
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
- name: Install dependencies
run: uv sync --dev
- name: Check dependency licenses
run: >-
uv run pip-licenses
--allow-only="MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;Python-2.0;PSF-2.0"
--partial-match
dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Dependency review
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4
with:
deny-licenses: >-
GPL-2.0-only, GPL-2.0-or-later,
GPL-3.0-only, GPL-3.0-or-later,
AGPL-3.0-only, AGPL-3.0-or-later,
LGPL-2.0-only, LGPL-2.0-or-later,
LGPL-2.1-only, LGPL-2.1-or-later,
LGPL-3.0-only, LGPL-3.0-or-later
golden-sync-check:
runs-on: ubuntu-latest
# Secrets are not available to fork PRs, so skip the check there.
# Internal PRs and pushes to main always run it.
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ secrets.STARFIX_APP_ID }}
private-key: ${{ secrets.STARFIX_APP_PRIVATE_KEY }}
repositories: starfix
- name: Fetch authoritative fixture from starfix
run: |
gh api repos/nauticalab/starfix/contents/tests/golden/include_metadata_v0.3.json \
--jq '.content' | base64 -d > /tmp/upstream.json
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Fail on fixture drift
run: |
if [ ! -s /tmp/upstream.json ]; then
echo "ERROR: Could not fetch fixture from nauticalab/starfix main."
echo "Ensure nauticalab/starfix#main has tests/golden/include_metadata_v0.3.json"
echo "(starfix PLT-1735 PR must be merged before this check can pass)"
exit 1
fi
if ! diff tests/golden/include_metadata_v0.3.json /tmp/upstream.json; then
echo "ERROR: tests/golden/include_metadata_v0.3.json has drifted from nauticalab/starfix main."
echo "Copy the updated fixture from the starfix repo and commit it."
exit 1
fi