mirror of
https://github.com/pyapp-kit/superqt.git
synced 2025-07-21 12:11:07 +02:00
* remove qtcompat * change imports * change codecov * add dep * run tests against dalthviz branch * update * more replace * pin pyside6 for sake of test * add deprecation * drop qt 5.11 * unpin pyside6
180 lines
4.9 KiB
YAML
180 lines
4.9 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- main
|
|
tags:
|
|
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
name: ${{ matrix.platform }} py${{ matrix.python-version }} ${{ matrix.backend }}
|
|
runs-on: ${{ matrix.platform }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: [ubuntu-latest, windows-latest, macos-latest]
|
|
python-version: [3.7, 3.8, 3.9]
|
|
backend: [pyqt5, pyside2]
|
|
include:
|
|
# pyqt6 and pyside6 on latest platforms
|
|
- python-version: 3.9
|
|
platform: ubuntu-latest
|
|
backend: pyside6
|
|
screenshot: 1
|
|
- python-version: 3.9
|
|
platform: windows-latest
|
|
backend: pyside6
|
|
screenshot: 1
|
|
- python-version: 3.9
|
|
platform: macos-11.0
|
|
backend: pyside6
|
|
screenshot: 1
|
|
- python-version: 3.9
|
|
platform: ubuntu-latest
|
|
backend: pyqt6
|
|
- python-version: 3.9
|
|
platform: windows-latest
|
|
backend: pyqt6
|
|
- python-version: 3.9
|
|
platform: macos-11.0
|
|
backend: pyqt6
|
|
# py3.10
|
|
- python-version: "3.10"
|
|
platform: ubuntu-latest
|
|
backend: pyside6
|
|
- python-version: "3.10"
|
|
platform: ubuntu-latest
|
|
backend: pyqt5
|
|
- python-version: "3.10"
|
|
platform: ubuntu-latest
|
|
backend: pyqt6
|
|
|
|
# big sur, 3.9
|
|
- python-version: 3.9
|
|
platform: macos-11.0
|
|
backend: pyside2
|
|
- python-version: 3.9
|
|
platform: macos-11.0
|
|
backend: pyqt5
|
|
|
|
# legacy OS
|
|
- python-version: 3.8
|
|
platform: ubuntu-18.04
|
|
backend: pyside2
|
|
- python-version: 3.6
|
|
platform: windows-2016
|
|
backend: pyqt5
|
|
|
|
# legacy Qt
|
|
- python-version: 3.7
|
|
platform: ubuntu-latest
|
|
backend: pyqt512
|
|
- python-version: 3.7
|
|
platform: ubuntu-latest
|
|
backend: pyqt513
|
|
- python-version: 3.7
|
|
platform: ubuntu-latest
|
|
backend: pyqt514
|
|
|
|
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- uses: tlambert03/setup-qt-libs@v1
|
|
|
|
- name: Linux opengl
|
|
if: runner.os == 'Linux' && ( matrix.backend == 'pyside6' || matrix.backend == 'pyqt6' )
|
|
run: sudo apt-get install -y libopengl0 libegl1-mesa libxcb-xinput0
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install setuptools tox tox-gh-actions
|
|
|
|
- name: Test with tox
|
|
uses: GabrielBB/xvfb-action@v1
|
|
timeout-minutes: 3
|
|
with:
|
|
run: tox
|
|
env:
|
|
PLATFORM: ${{ matrix.platform }}
|
|
BACKEND: ${{ matrix.backend }}
|
|
|
|
- name: Coverage
|
|
uses: codecov/codecov-action@v1
|
|
|
|
- name: Install for screenshots
|
|
if: matrix.screenshot
|
|
run: pip install . ${{ matrix.backend }}
|
|
|
|
- name: Screenshots (Linux)
|
|
if: runner.os == 'Linux' && matrix.screenshot
|
|
uses: GabrielBB/xvfb-action@v1
|
|
with:
|
|
run: python examples/demo_widget.py -snap
|
|
|
|
- name: Screenshots (macOS/Win)
|
|
if: runner.os != 'Linux' && matrix.screenshot
|
|
run: python examples/demo_widget.py -snap
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
if: matrix.screenshot
|
|
with:
|
|
name: screenshots ${{ runner.os }}
|
|
path: screenshots
|
|
|
|
check_manifest:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
- name: Check manifest
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install check-manifest
|
|
check-manifest
|
|
|
|
deploy:
|
|
# this will run when you have tagged a commit, starting with "v*"
|
|
# and requires that you have put your twine API key in your
|
|
# github secrets (see readme for details)
|
|
needs: [test, check_manifest]
|
|
if: ${{ github.repository == 'napari/superqt' && contains(github.ref, 'tags') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine
|
|
- name: Build and publish
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
|
|
run: |
|
|
git tag
|
|
python -m build
|
|
twine check dist/*
|
|
twine upload dist/*
|