Skip to content

DICOM reliability, report robustness, and integration examples #5

DICOM reliability, report robustness, and integration examples

DICOM reliability, report robustness, and integration examples #5

Workflow file for this run

name: Tests
# Runs on every PR and on pushes to main.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
unit-tests:
name: Unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false # run both Python versions even if one fails, so we see both
matrix:
# 3.11+ only: the package uses `match` and `int | float` unions (3.10+)
# and requires-python is >=3.11. Older versions fail on import.
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: package/pyproject.toml
# The workflow lives at repo root, but the package is in ./package,
# so every step below runs from there (matches local dev from package/).
- name: Install package with test dependencies
working-directory: ./package
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
# --check / --check-only report only; they never edit. CI fails if code
# was committed unformatted. Mirrors the local pre-commit checks.
- name: Check formatting (Black)
working-directory: ./package
run: black --check tests/
- name: Check import order (isort)
working-directory: ./package
run: isort --check-only tests/
# -m "not integration": runs everything except tests marked @pytest.mark.integration.
# (no integration tests yet)
- name: Run unit tests
working-directory: ./package
run: pytest -v -m "not integration"
integration-tests:
name: Integration tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: package/pyproject.toml
- name: Install package with test dependencies
working-directory: ./package
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
# Runs only @pytest.mark.integration tests against the committed example set
# (tests/integration/examples). With no examples yet this is a clean skip.
- name: Run integration tests
working-directory: ./package
run: pytest -v -m integration