Skip to content

fix: support reusing field-input components in event-driven flows #986

fix: support reusing field-input components in event-driven flows

fix: support reusing field-input components in event-driven flows #986

Workflow file for this run

name: Lint and test
on:
push:
branches:
- "main"
pull_request:
types:
- opened
- synchronize
- reopened
permissions:
contents: read
jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install project
run: uv sync --group test --group docs
- name: Check uv lockfile
run: uv lock --check
if: always()
- name: Ruff linting
run: uv run ruff check .
if: always()
- name: Ruff formatting
run: uv run ruff format --check .
if: always()
- name: Type checking
run: |
uv run mypy plugboard/ --explicit-package-bases
uv run mypy plugboard-schemas/plugboard_schemas/ --explicit-package-bases
uv run mypy tests/
if: always()
- name: Code complexity
run: uv run xenon --max-absolute B --max-modules A --max-average A plugboard/
if: always()
- name: Notebook output cleared
run: find . -name '*.ipynb' -not -path "./.venv/*" -exec uv run nbstripout --verify {} +
if: always()
- name: Check open source licenses
run: uv run licensecheck --requirements-paths ./pyproject.toml --zero --skip-dependencies plugboard-schemas
- name: Build docs
run: uv run mkdocs build --site-dir /tmp/site
if: always()
test-unit:
name: Tests - unit
runs-on: ubuntu-latest
timeout-minutes: 8
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install project
run: uv sync --group test
- name: Run unit tests
run: COVERAGE_FILE=.coverage.py${{ matrix.python_version }}.unit uv run coverage run -m pytest ./tests/unit/
env:
RAY_ENABLE_UV_RUN_RUNTIME_ENV: 0
PLUGBOARD_IO_READ_TIMEOUT: 5.0
- name: Upload unit test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-unit-py${{ matrix.python_version }}
include-hidden-files: true
path: .coverage.py${{ matrix.python_version }}.unit*
test-integration:
name: Tests - integration
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install project
run: uv sync --group test
- name: Run backing services
run: |
docker compose up -d
sleep 10 # Wait for services to start
- name: Run integration tests
run: COVERAGE_FILE=.coverage.py${{ matrix.python_version }}.integration uv run coverage run -m pytest ./tests/integration/ -m "not tuner"
env:
RABBITMQ_URL: amqp://user:password@localhost:5672/
REDIS_URL: redis://default:password@localhost:6379/
RAY_ENABLE_UV_RUN_RUNTIME_ENV: 0
PLUGBOARD_IO_READ_TIMEOUT: 5.0
- name: Upload integration test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration-py${{ matrix.python_version }}
include-hidden-files: true
path: .coverage.py${{ matrix.python_version }}.integration*
test-integration-tuner:
name: Tests - integration:tuner
runs-on: ubuntu-latest
timeout-minutes: 8
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install project
run: uv sync --group test
- name: Run tuner tests
run: COVERAGE_FILE=.coverage.py${{ matrix.python_version }}.integration.tuner uv run coverage run -m pytest ./tests/integration/ -m "tuner"
env:
RABBITMQ_URL: amqp://user:password@localhost:5672/
REDIS_URL: redis://default:password@localhost:6379/
RAY_ENABLE_UV_RUN_RUNTIME_ENV: 0
PLUGBOARD_IO_READ_TIMEOUT: 5.0
- name: Upload tuner test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration-tuner-py${{ matrix.python_version }}
include-hidden-files: true
path: .coverage.py${{ matrix.python_version }}.integration.tuner*
test-smoke:
name: Tests - smoke
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install project
run: uv sync --group test
- name: Run smoke tests
run: uv run pytest ./tests/smoke/
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
coverage-report:
name: Report coverage
needs: [test-unit, test-integration, test-integration-tuner] # Depends on tests passing
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install project
run: uv sync --group test
- name: Download unit and integration test coverage
uses: actions/download-artifact@v4
with:
pattern: coverage-*-py${{matrix.python_version}}
path: .
merge-multiple: true
- name: Combine coverage reports
run: uv run coverage combine
- name: Generate coverage XML
run: uv run coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: plugboard-dev/plugboard
files: coverage.xml # Specify the combined file
flags: py${{ matrix.python_version }}
build:
name: Build package
needs: [lint, test-unit, test-integration] # Depends on lint and tests passing
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [3.12, 3.13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Build package
run: uv build --all-packages
- name: Install from wheel
working-directory: ./dist
run: uv pip install --system *.whl
- name: Smoke test package
working-directory: ./dist
run: python -c "from plugboard import library"