Skip to content

Refactor plugin scanning architecture and enhance type safety #26

Refactor plugin scanning architecture and enhance type safety

Refactor plugin scanning architecture and enhance type safety #26

Workflow file for this run

name: Python package CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install fire pytest pytest-cov # Added pytest-cov for coverage
- name: Run tests with coverage
run: |
python -m pip install -e .
# Pytest is configured in pyproject.toml to run with --cov
# and output to term-missing. It also creates .coverage file.
pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
# token: ${{ secrets.CODECOV_TOKEN }} # Only if needed for private repos or specific cases
fail_ci_if_error: true # Optional: fail CI if coverage upload fails
publish:
needs: build-and-test
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install --upgrade build twine
python -m build
twine upload dist/*