Skip to content

Release 1.8.1: fix browser optional dependency test collection #114

Release 1.8.1: fix browser optional dependency test collection

Release 1.8.1: fix browser optional dependency test collection #114

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
security-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies (for audit)
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
- name: Install pip-audit
run: |
python -m pip install pip-audit
- name: Audit installed environment
run: |
pip-audit
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run linter (Ruff)
run: |
ruff check src tests examples
- name: Run formatter check (Black)
run: |
black --check src tests examples
continue-on-error: ${{ matrix.python-version == '3.9' }}
- name: Run type checker (MyPy)
run: |
mypy src --ignore-missing-imports
- name: Compile examples
run: |
python -m compileall examples
- name: Run tests with coverage (coverage CLI for reliability)
run: |
python -m coverage run -m pytest -p no:cov -v tests
python -m coverage report -m
python -m coverage xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/