Skip to content

Introduce more robust SBOL-based provenance #25

Introduce more robust SBOL-based provenance

Introduce more robust SBOL-based provenance #25

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
workflow_call:
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python }} / ${{ matrix.dependencies }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12"]
dependencies: [core, robots]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
python-version: ${{ matrix.python }}
- name: Install core dependencies
if: matrix.dependencies == 'core'
run: uv sync --locked
- name: Install optional robot SDKs
if: matrix.dependencies == 'robots'
run: uv sync --locked --all-extras
- name: Lint and type check
if: matrix.python == '3.12' && matrix.dependencies == 'robots'
run: |
uv run --no-sync ruff check .
uv run --no-sync mypy
- name: Run tests
run: uv run --no-sync pytest -q
build:
name: Build and check distributions
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
python-version: "3.12"
- run: uv sync --locked
- name: Check release tag matches package version
if: github.event_name == 'release'
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
uv run --no-sync python - <<'PY'
import os
from importlib.metadata import version
expected = f"v{version('lab-compiler')}"
if os.environ["RELEASE_TAG"] != expected:
raise SystemExit(f"Release tag must be {expected}")
PY
- name: Build wheel and source distribution
run: uv build --no-sources
- name: Check PyPI metadata and README
run: uv run --no-sync twine check --strict dist/*
- name: Check isolated installs from wheel and source distribution
run: |
for artifact in dist/*.whl dist/*.tar.gz; do
environment="$RUNNER_TEMP/install-$(basename "$artifact")"
uv venv "$environment"
uv pip install --python "$environment/bin/python" "$artifact"
"$environment/bin/python" -I scripts/check_install.py
done
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: distributions
path: dist/
if-no-files-found: error