Skip to content

Consolidate batch circuit generation into BaseEncoding template methods #35

Consolidate batch circuit generation into BaseEncoding template methods

Consolidate batch circuit generation into BaseEncoding template methods #35

Workflow file for this run

# .github/workflows/ci.yml
#
# Continuous Integration: runs on every push and pull request.
# Tests the package across Python versions and operating systems,
# enforces code quality (linting, formatting, type checking),
# and verifies the package builds correctly.
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
jobs:
# ── Job 1: Lint ─────────────────────────────────────────────
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Ruff (linting)
run: ruff check src tests
- name: Black (formatting)
run: black --check src tests
# mypy disabled until type annotations are cleaned up (105 errors in 23 files)
# - name: mypy (type checking)
# run: mypy src
# ── Job 2: Test ─────────────────────────────────────────────
test:
name: Test / Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: lint
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.10"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev,qiskit]"
- name: Run tests with coverage
run: |
pytest --cov=encoding_atlas --cov-report=xml --cov-report=term-missing --cov-fail-under=0 -v -m "not slow"
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
fail_ci_if_error: false
# Backend-specific tests (qiskit, cirq) disabled — no tests use
# requires_qiskit/requires_cirq markers yet. Re-enable when added.
# ── Job 4: Build Package ───────────────────────────────────
build:
name: Build Package
runs-on: ubuntu-latest
needs: test
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build sdist and wheel
run: python -m build
- name: Validate package metadata
run: twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7
# ── Job 5: Build Documentation ─────────────────────────────
docs:
name: Build Documentation
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[docs]"
- name: Build MkDocs (strict mode)
run: mkdocs build --strict