CI #2519
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: | |
- v* | |
pull_request: | |
branches: | |
- "**" | |
schedule: | |
# Daily at 05:47 | |
- cron: '47 5 * * *' | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }} | |
cancel-in-progress: true | |
jobs: | |
Builds: | |
name: '${{ matrix.name }}' | |
timeout-minutes: 10 | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python: '3.10' | |
name: 'Build source' | |
pep517_option: '--source' | |
- python: '3.10' | |
name: 'Build binary' | |
pep517_option: '--binary' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '${{ matrix.python }}' | |
- name: Build | |
run: |- | |
python -m venv venv | |
venv/bin/python -m pip install --quiet --upgrade pip setuptools wheel | |
venv/bin/python -m pip install --quiet --upgrade pep517 twine | |
venv/bin/python -m pip list | |
venv/bin/python -m pip freeze | |
venv/bin/python -m pep517.build ${{ matrix.pep517_option }} --out-dir dist/ . | |
venv/bin/python -m twine check --strict dist/* | |
- name: Publish | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist/ | |
Checks: | |
name: '${{ matrix.name }}' | |
timeout-minutes: 10 | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python: '3.9' | |
check_docs: '1' | |
name: 'Check docs' | |
qt_library: 'PySide2' | |
- python: '3.9' | |
check_formatting: '1' | |
name: 'Check formatting' | |
qt_library: 'PySide2' | |
- python: '3.9' | |
check_type_hints: '1' | |
name: 'Check type hints (PySide2)' | |
qt_library: 'PySide2' | |
- python: '3.10' | |
check_type_hints: '1' | |
name: 'Check type hints (PyQt5)' | |
qt_library: 'PyQt5' | |
- python: '3.9' | |
check_manifest: '1' | |
name: 'Check manifest' | |
qt_library: 'PySide2' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '${{ matrix.python }}' | |
- name: Run tests | |
run: ./ci.sh | |
env: | |
CHECK_DOCS: '${{ matrix.check_docs }}' | |
CHECK_FORMATTING: '${{ matrix.check_formatting }}' | |
CHECK_TYPE_HINTS: '${{ matrix.check_type_hints }}' | |
CHECK_MANIFEST: '${{ matrix.check_manifest }}' | |
# Should match 'name:' up above | |
JOB_NAME: '${{ matrix.name }}' | |
# TODO: needs some Qt library but I'm not clear the implications of | |
# choosing one over the other | |
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_checks,p_docs]' | |
Windows: | |
name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}, ${{ matrix.qt_library }})' | |
timeout-minutes: 20 | |
runs-on: 'windows-latest' | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
arch: ['x86', 'x64'] | |
qt_library: ['PyQt5', 'PySide2'] | |
exclude: | |
- python: '3.10' | |
qt_library: 'PySide2' | |
- python: '3.11' | |
qt_library: 'PySide2' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '${{ matrix.python }}.0-alpha - ${{ matrix.python }}.X' | |
architecture: '${{ matrix.arch }}' | |
- name: Run tests | |
run: ./ci.sh | |
shell: bash | |
env: | |
# Should match 'name:' up above | |
JOB_NAME: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}, ${{ matrix.qt_library }})' | |
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_tests]' | |
# TODO: https://github.com/pytest-dev/pytest/issues/7623 | |
PYTHONIOENCODING: 'utf-8' | |
Linux: | |
name: 'Linux (${{ matrix.python }}, ${{ matrix.qt_library }})' | |
timeout-minutes: 10 | |
runs-on: 'ubuntu-latest' | |
container: 'docker://python:${{ matrix.python }}-buster' | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
qt_library: ['PyQt5', 'PySide2'] | |
exclude: | |
- python: '3.10' | |
qt_library: 'PySide2' | |
- python: '3.11' | |
qt_library: 'PySide2' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Qt5 dependencies | |
run: | | |
apt-get update --yes | |
apt-get install --yes libgl1 | |
- name: Install Linux test dependencies | |
run: | | |
apt-get update --yes | |
apt-get install --yes libgl1-mesa-dev xvfb x11-utils libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 | |
- uses: altendky/QTBUG-88688-libxcb-util@v2 | |
- name: Run tests | |
run: ./ci.sh | |
env: | |
# Should match 'name:' up above | |
JOB_NAME: 'Linux (${{ matrix.python }}, ${{ matrix.qt_library }})' | |
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_tests]' | |
macOS: | |
name: 'macOS (${{ matrix.python }}, ${{matrix.qt_library}})' | |
timeout-minutes: 10 | |
runs-on: 'macos-latest' | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
qt_library: ['PyQt5', 'PySide2'] | |
exclude: | |
- python: '3.10' | |
qt_library: 'PySide2' | |
- python: '3.11' | |
qt_library: 'PySide2' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '${{ matrix.python }}.0-alpha - ${{ matrix.python }}.X' | |
- name: Run tests | |
run: ./ci.sh | |
env: | |
# Should match 'name:' up above | |
JOB_NAME: 'macOS (${{ matrix.python }}, ${{matrix.qt_library}})' | |
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_tests]' | |
all: | |
name: All | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- Builds | |
- Checks | |
- Windows | |
- Linux | |
- macOS | |
steps: | |
- name: Require all successes | |
uses: re-actors/[email protected] | |
with: | |
jobs: ${{ toJSON(needs) }} |