-
Notifications
You must be signed in to change notification settings - Fork 56
135 lines (114 loc) · 4.17 KB
/
main.yml
File metadata and controls
135 lines (114 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Tests
on:
push:
branches:
- master
- develop
pull_request:
branches:
- "**"
concurrency:
group: tests-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }} / ${{ matrix.qt-version }}
runs-on: ${{ matrix.image }}
strategy:
matrix:
os: [ubuntu, windows, macos-x86_64, macos-arm64]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
qt-version: ["pyside2", "pyside6", "pyqt5", "pyqt6"]
include:
- os: ubuntu
image: ubuntu-24.04
- os: windows
image: windows-2022
- os: macos-x86_64
image: macos-13
- os: macos-arm64
image: macos-14
exclude:
# pyside2 does not publish arm64 packages
- os: macos-arm64
qt-version: pyside2
# pyside2 requires python <3.11
- python-version: "3.11"
qt-version: pyside2
- python-version: "3.12"
qt-version: pyside2
- python-version: "3.13"
qt-version: pyside2
- python-version: "3.14-dev"
qt-version: pyside2
- python-version: "3.14-dev"
os: windows
# pyside6 and pyqt6 require python >=3.9
- python-version: "3.8"
qt-version: pyside6
- python-version: "3.8"
qt-version: pyqt6
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.4 python - -y
- name: Update Path
if: ${{ matrix.os != 'windows' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Update Path for Windows
if: ${{ matrix.os == 'windows' }}
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
- name: Enable long paths on Windows
if: ${{ matrix.os == 'windows' }}
run: git config --system core.longpaths true
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Setup cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.qt-version }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Valdate cache
if: steps.cache.outputs.cache-hit == 'true'
run: |
# `timeout` is not available on macos, so we define a custom function.
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
timeout 10s poetry run pip --version || rm -rf .venv
- name: Check lock file
run: poetry check --lock
- name: Delete any stray venvs
run: poetry env remove --all
- name: Install dependencies
run: poetry install --with github-actions
# - name: Run mypy
# run: poetry run mypy
- name: Install Qt
run: poetry run pip install --ignore-installed ${{ matrix.qt-version }}
- name: Install libxcb dependencies
if: ${{ matrix.os == 'ubuntu' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get -qq update
sudo apt-get -qq install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl-dev
- name: Run pytest
uses: coactions/setup-xvfb@v1
env:
QT_API: ${{ matrix.qt-version }}
with:
run: poetry run pytest --cov qasync -v