Skip to content

Improve CI jobs

Improve CI jobs #5

Workflow file for this run

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 & verify package
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 }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
needs: build
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.build-package.outputs.supported-python-versions) }}
os:
- ubuntu-latest
- macos-latest
steps:
- name: Download built package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1
- 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 .)