Skip to content

CI

CI #1049

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # run once a day
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
pip-post-installs: ${{ matrix.pydantic }}
pip-install-pre-release: ${{ github.event_name == 'schedule' }}
coverage-upload: artifact
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
pydantic: [""]
exclude:
- python-version: "3.8"
os: "macos-latest"
include:
- python-version: "3.8"
os: "macos-13"
- python-version: "3.9"
os: "macos-13"
- python-version: "3.11"
os: "ubuntu-latest"
- python-version: "3.12"
os: "ubuntu-latest"
pydantic: "'pydantic<2'"
- python-version: "3.8"
os: "ubuntu-latest"
pydantic: "'pydantic<2'"
test-qt:
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
qt: ${{ matrix.qt }}
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
extras: test-qt
pip-install-pre-release: ${{ github.event_name == 'schedule' }}
coverage-upload: artifact
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.8"
os: "ubuntu-latest"
qt: "PyQt5==5.12"
- python-version: "3.10"
os: "ubuntu-latest"
qt: "PyQt5~=5.15.0"
- python-version: "3.10"
os: "ubuntu-latest"
qt: "PySide2~=5.15.0"
- python-version: "3.10"
os: "ubuntu-latest"
qt: "PyQt6~=6.2.0"
- python-version: "3.10"
os: "ubuntu-latest"
qt: "PySide6~=6.3.0"
- python-version: "3.10"
os: "ubuntu-latest"
qt: "PyQt6~=6.4.0"
- python-version: "3.11"
os: "ubuntu-latest"
qt: "PySide6~=6.5.0"
- python-version: "3.11"
os: "ubuntu-latest"
qt: "PySide6~=6.6.0"
- python-version: "3.11"
os: "ubuntu-latest"
qt: pyqt6
- python-version: "3.10"
os: "windows-latest"
qt: "PySide2"
- python-version: "3.9"
os: "macos-13"
qt: "PySide2"
upload_coverage:
if: always()
needs: [test, test-qt]
uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
secrets: inherit
test_napari:
uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v2
with:
dependency-repo: napari/napari
dependency-ref: ${{ matrix.napari-version }}
dependency-extras: "testing"
qt: ${{ matrix.qt }}
pytest-args: 'napari/_qt/_qapp_model napari/_app_model napari/utils/_tests/test_key_bindings.py -k "not async and not qt_dims_2"'
python-version: "3.10"
post-install-cmd: "pip install lxml_html_clean" # fix for napari v0.4.19
strategy:
fail-fast: false
matrix:
napari-version: ["", "v0.4.19.post1"]
qt: ["pyqt5", "pyside2"]
check-manifest:
name: Check Manifest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run check-manifest
deploy:
name: Deploy
needs: [check-manifest, test, test_napari]
if: success() && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: 👷 Build
run: |
python -m pip install build
python -m build
- name: 🚢 Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: "./dist/*"