-
Notifications
You must be signed in to change notification settings - Fork 12
137 lines (123 loc) · 4.34 KB
/
python-tests.yml
File metadata and controls
137 lines (123 loc) · 4.34 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
136
137
name: Python Tests with PyQt6
permissions:
contents: read
on:
workflow_call:
inputs:
os:
required: true
type: string
backend:
required: true
type: string
repository:
required: false
type: string
default: ""
ref:
required: false
type: string
default: ""
workflow_dispatch:
inputs:
os:
description: "Runner OS"
required: true
type: choice
options:
- ubuntu-22.04
- windows-latest
- macos-latest
backend:
description: "Backend selector passed to pytest as --<backend>"
required: true
type: choice
options:
- fulcrum
- cbf
repository:
description: "Repository to checkout (owner/name). Leave empty for current repo."
required: false
type: string
default: ""
ref:
description: "Git ref to checkout (branch/tag/SHA). Leave empty for event ref."
required: false
type: string
default: ""
jobs:
test:
runs-on: ${{ inputs.os }}
timeout-minutes: 15
strategy:
matrix:
python-version: ['3.12']
env:
DISPLAY: ":99.0" # Display setting for Xvfb on Linux
QT_SELECT: "qt6" # Environment variable to select Qt6
steps:
- uses: actions/checkout@v5
with:
repository: ${{ inputs.repository != '' && inputs.repository || github.repository }}
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }}
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
libglib2.0-0 \
libegl1 \
libgl1-mesa-dev \
'^libxcb.*-dev' \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Start Xvfb
if: runner.os == 'Linux'
run: |
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
sleep 3
sleep 1
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run General Tests
run: |
poetry run pytest -m 'not marker_qt_1 and not marker_qt_2 and not marker_qt_3' -vvv --log-cli-level=DEBUG --setup-show --maxfail=1 --${{ inputs.backend }}
- name: Run Tests for marker_qt_1
run: |
poetry run pytest -m 'marker_qt_1' -vvv --log-cli-level=DEBUG --setup-show --maxfail=1 --${{ inputs.backend }}
- name: Run Tests for marker_qt_2
run: |
poetry run pytest -m 'marker_qt_2' -vvv --log-cli-level=DEBUG --setup-show --maxfail=1 --${{ inputs.backend }}
- name: Run Tests for marker_qt_3
run: |
poetry run pytest -m 'marker_qt_3' -vvv --log-cli-level=DEBUG --setup-show --maxfail=1 --${{ inputs.backend }}
- name: Upload output Files from tests/output
if: always() # This ensures the step runs regardless of previous failures
uses: actions/upload-artifact@v4
with:
name: pytest-output-${{ matrix.python-version }}-${{ inputs.os }}-${{ inputs.backend }}
path: tests/output