[pre-commit.ci] pre-commit autoupdate #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
FORCE_COLOR: 1 | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
PIP_NO_PYTHON_VERSION_WARNING: 1 | |
permissions: {} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
id: baipp | |
outputs: | |
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | |
test: | |
name: Test on Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ${{ fromJson(needs.build.outputs.python-versions) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download built package | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
${{ matrix.python-version }} | |
3.x | |
allow-prereleases: true | |
- uses: astral-sh/setup-uv@v2 | |
- run: uv pip install --system tox-uv | |
- name: Test | |
run: python -Im tox run --installpkg dist/*.whl -f py$(echo ${{ matrix.python-version }} | tr -d .) | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-data-${{ matrix.python-version }} | |
path: .coverage.* | |
include-hidden-files: true | |
if-no-files-found: ignore | |
coverage: | |
name: Coverage | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- uses: astral-sh/setup-uv@v1 | |
- run: uv pip install --system --upgrade coverage[toml] covdefaults | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-data-* | |
merge-multiple: true | |
- name: Combine coverage & report | |
run: | | |
python -Im coverage combine | |
python -Im coverage report || true | |
python -Im coverage html --skip-covered --skip-empty || true | |
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY | |
- name: Upload HTML report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-html | |
path: htmlcov | |
if: ${{ failure() }} | |
mypy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- uses: astral-sh/setup-uv@v2 | |
- run: uvx mypy src |