-
Notifications
You must be signed in to change notification settings - Fork 55
131 lines (115 loc) · 3.82 KB
/
main.yml
File metadata and controls
131 lines (115 loc) · 3.82 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
name: Tests
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
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"]
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
# 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@v5
- 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: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.3"
enable-cache: true
- name: Install qasync
run: uv sync --locked --group dev
- name: Install qt ${{ matrix.qt-version }}
run: uv pip install ${{ matrix.qt-version }}
- name: Run tests
uses: coactions/setup-xvfb@v1
env:
QT_API: "${{ matrix.qt_version }}"
COVERAGE_FILE: ".coverage.${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.qt-version }}"
with:
run: uv run coverage run --context=${{matrix.qt-version}}
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.qt-version }}
path: .coverage.${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.qt-version }}
include-hidden-files: true
coverage:
name: collect coverage
runs-on: ubuntu-latest
needs: tests
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Download coverage artifacts
uses: actions/download-artifact@v6
with:
pattern: coverage-*
merge-multiple: true
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3.37
with:
GITHUB_TOKEN: ${{ github.token }}
MERGE_COVERAGE_FILES: true
ANNOTATE_MISSING_LINES: true
- name: Store coverage comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt