| 1 |
name : Run tests |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
test: |
| 7 |
runs-on: ${{ matrix.os }} |
| 8 |
timeout-minutes: 5 |
| 9 |
env: |
| 10 |
PYTHONFAULTHANDLER: 1 |
| 11 |
PIP_NO_PIP_VERSION_CHECK: 1 |
| 12 |
PIP_CACHE_DIR: .pip-cache |
| 13 |
PIP_PREFER_BINARY: 1 |
| 14 |
|
| 15 |
strategy: |
| 16 |
fail-fast: False |
| 17 |
matrix: |
| 18 |
include: |
| 19 |
# Linux |
| 20 |
- os: ubuntu-20.04 |
| 21 |
python-version: 3.6 |
| 22 |
test-env: "PyQt5~=5.9.2" |
| 23 |
qt-api: "PyQt5" |
| 24 |
|
| 25 |
- os: ubuntu-18.04 |
| 26 |
python-version: 3.7 |
| 27 |
test-env: "PyQt5~=5.12.0" |
| 28 |
qt-api: "PyQt5" |
| 29 |
|
| 30 |
- os: ubuntu-20.04 |
| 31 |
python-version: 3.8 |
| 32 |
test-env: "PyQt5~=5.14.0" |
| 33 |
qt-api: "PyQt5" |
| 34 |
|
| 35 |
- os: ubuntu-20.04 |
| 36 |
python-version: 3.9 |
| 37 |
test-env: "PyQt5~=5.15.0" |
| 38 |
qt-api: "PyQt5" |
| 39 |
|
| 40 |
- os: ubuntu-20.04 |
| 41 |
python-version: "3.10" |
| 42 |
test-env: "PyQt5~=5.15.0" |
| 43 |
qt-api: "PyQt5" |
| 44 |
|
| 45 |
- os: ubuntu-20.04 |
| 46 |
python-version: "3.10" |
| 47 |
test-env: "PyQt6~=6.2.3 PyQt6-Qt6~=6.2.3" |
| 48 |
qt-api: "PyQt6" |
| 49 |
|
| 50 |
- os: ubuntu-20.04 |
| 51 |
python-version: "3.10" |
| 52 |
test-env: "PySide2~=5.15.0" |
| 53 |
qt-api: "PySide2" |
| 54 |
|
| 55 |
# macOS |
| 56 |
- os: macos-10.15 |
| 57 |
python-version: 3.6 |
| 58 |
test-env: "PyQt5~=5.9.2" |
| 59 |
|
| 60 |
- os: macos-10.15 |
| 61 |
python-version: 3.7 |
| 62 |
test-env: "PyQt5~=5.12.0" |
| 63 |
|
| 64 |
- os: macos-10.15 |
| 65 |
python-version: 3.8 |
| 66 |
test-env: "PyQt5~=5.14.0" |
| 67 |
|
| 68 |
- os: macos-10.15 |
| 69 |
python-version: 3.9 |
| 70 |
test-env: "PyQt5~=5.15.0" |
| 71 |
|
| 72 |
- os: macos-11 |
| 73 |
python-version: "3.10" |
| 74 |
test-env: "PyQt5~=5.15.0" |
| 75 |
|
| 76 |
- os: macos-11 |
| 77 |
python-version: "3.10" |
| 78 |
test-env: "PyQt6~=6.2.3 PyQt6-Qt6~=6.2.3" |
| 79 |
|
| 80 |
- os: macos-11 |
| 81 |
python-version: "3.10" |
| 82 |
test-env: "PySide2~=5.15.0" |
| 83 |
|
| 84 |
# Windows |
| 85 |
- os: windows-2019 |
| 86 |
python-version: 3.6 |
| 87 |
test-env: "PyQt5~=5.9.2" |
| 88 |
|
| 89 |
- os: windows-2019 |
| 90 |
python-version: 3.7 |
| 91 |
test-env: "PyQt5~=5.12.0" |
| 92 |
|
| 93 |
- os: windows-2019 |
| 94 |
python-version: 3.8 |
| 95 |
test-env: "PyQt5~=5.14.0" |
| 96 |
|
| 97 |
- os: windows-2019 |
| 98 |
python-version: 3.9 |
| 99 |
test-env: "PyQt5~=5.15.0" |
| 100 |
|
| 101 |
- os: windows-2019 |
| 102 |
python-version: "3.10" |
| 103 |
test-env: "PyQt5~=5.15.0" |
| 104 |
|
| 105 |
- os: windows-2019 |
| 106 |
python-version: "3.10" |
| 107 |
test-env: "PyQt6~=6.2.3 PyQt6-Qt6~=6.2.3" |
| 108 |
|
| 109 |
- os: windows-2019 |
| 110 |
python-version: "3.10" |
| 111 |
test-env: "PySide2~=5.15.0" |
| 112 |
|
| 113 |
steps: |
| 114 |
- uses: actions/checkout@v2 |
| 115 |
- name: Setup Python |
| 116 |
uses: actions/setup-python@v2 |
| 117 |
with: |
| 118 |
python-version: ${{ matrix.python-version }} |
| 119 |
|
| 120 |
- name: Install System Deps |
| 121 |
if: ${{ startsWith(runner.os, 'Linux') }} |
| 122 |
# https://www.riverbankcomputing.com/pipermail/pyqt/2020-June/042949.html |
| 123 |
run: sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libegl1-mesa libxcb-shape0 |
| 124 |
|
| 125 |
- name: Setup Pip Cache |
| 126 |
uses: actions/cache@v2 |
| 127 |
with: |
| 128 |
path: .pip-cache |
| 129 |
key: ${{ runner.os }}-py-${{ matrix.python-version }}-pip-${{ hashFiles('setup.*', '.github/workflows/test-workflow.yml') }} |
| 130 |
restore-keys: | |
| 131 |
${{ runner.os }}-py-${{ matrix.python-version }}-pip |
| 132 |
|
| 133 |
- name: Install Test Deps |
| 134 |
env: |
| 135 |
TEST_ENV: ${{ matrix.test-env }} |
| 136 |
TEST_DEPS: pytest pytest-cov codecov wheel |
| 137 |
run: python -m pip install $TEST_DEPS $TEST_ENV |
| 138 |
shell: bash |
| 139 |
|
| 140 |
- name: Install |
| 141 |
run: python -m pip install -e . |
| 142 |
|
| 143 |
- name: List Test Env |
| 144 |
run: pip list --format=freeze |
| 145 |
|
| 146 |
- name: Run Tests |
| 147 |
if: ${{ !startsWith(runner.os, 'Linux') }} |
| 148 |
run: pytest -v --cov=AnyQt |
| 149 |
|
| 150 |
- name: Run Tests with Xvfb |
| 151 |
if: ${{ startsWith(runner.os, 'Linux') }} |
| 152 |
env: |
| 153 |
XVFBARGS: "-screen 0 1280x1024x24" |
| 154 |
run: catchsegv xvfb-run -a -s "$XVFBARGS" pytest -v --cov=AnyQt |
| 155 |
|
| 156 |
- name: Test import hooks |
| 157 |
if: ${{ startsWith(runner.os, 'Linux') && matrix.qt-api == 'PyQt5' }} |
| 158 |
run: | |
| 159 |
ANYQT_HOOK_BACKPORT=PyQt4 python -c "import AnyQt.QtCore, PyQt4" |
| 160 |
|
| 161 |
- name: Upload Coverage |
| 162 |
run: codecov |