REL: use uv-build for publication #886
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: | |
pull_request: | |
paths-ignore: | |
- gallery/** | |
- README.md | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
# auto-cancel any in-progress job *on the same branch* | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
unit-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
python-version: | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
- '3.13' | |
include: | |
- os: macos-latest | |
python-version: '3.13' | |
- os: windows-latest | |
python-version: '3.13' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup uv | |
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a # v5.1.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Test | |
shell: bash # windows compat | |
run: | | |
uv run --frozen --group test --group covcheck --dev \ | |
coverage run -m pytest --color=yes | |
- name: Upload coverage data | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
with: | |
name: wxc_coverage_data-${{ matrix.os }}-${{ matrix.python-version }} | |
path: .coverage.* | |
if-no-files-found: ignore | |
include-hidden-files: true | |
coverage: | |
name: Combine & check coverage | |
runs-on: ubuntu-latest | |
needs: unit-tests | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup uv | |
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a # v5.1.0 | |
with: | |
python-version: '3.13' | |
- run: uv sync --only-group covcheck | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
pattern: wxc_coverage_data-* | |
merge-multiple: true | |
- name: Check coverage | |
run: | | |
uv run --frozen --only-group covcheck coverage combine | |
uv run --frozen --only-group covcheck coverage html --skip-covered --skip-empty | |
uv run --frozen --only-group covcheck coverage report --fail-under=95 | |
- name: Upload HTML report if check failed. | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
with: | |
name: wxc_coverage_report | |
path: htmlcov | |
if: ${{ failure() }} | |
type-check: | |
runs-on: ubuntu-latest | |
name: type check | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
python-version: | |
# Match minimal supported Python version | |
# to make sure we're not using unparseable syntax, | |
# and also run on the most recent version possible to make sure | |
# the code typechecks also there | |
- '3.10' | |
- '3.13' | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup uv | |
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a # v5.1.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run mypy | |
run: uv run --frozen --group typecheck mypy src |