-
Notifications
You must be signed in to change notification settings - Fork 74
149 lines (131 loc) · 5.21 KB
/
ci.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
name: CI
on:
# Triggers the workflow on push only for the master branch or pull request events
push:
branches: [master]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
# This workflow contains a single job called "build"
build:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name-suffix: "PyQt5 sdist"
os: ubuntu-20.04
python-version: "3.8"
BUILD_OPTION: --sdist
QT_BINDING: PyQt5
RUN_TESTS_OPTIONS: --qt-binding=PyQt5 --no-opencl --low-mem
- name-suffix: "PyQt5 wheel"
os: macos-latest
python-version: "3.10"
BUILD_OPTION: --wheel
QT_BINDING: PyQt5
RUN_TESTS_OPTIONS: --qt-binding=PyQt5 --no-opencl --low-mem
- name-suffix: "PySide6 sdist"
os: ubuntu-latest
python-version: "3.8"
BUILD_OPTION: --sdist
QT_BINDING: PySide6
RUN_TESTS_OPTIONS: --qt-binding=PySide6 --no-opencl --low-mem
- name-suffix: "PySide6 wheel"
os: macos-latest
python-version: "3.9"
BUILD_OPTION: --wheel
QT_BINDING: "PySide6<6.7"
RUN_TESTS_OPTIONS: --qt-binding=PySide6 --no-opencl --low-mem
- name-suffix: "PyQt6 wheel"
os: ubuntu-latest
python-version: "3.11"
BUILD_OPTION: --wheel
QT_BINDING: PyQt6
RUN_TESTS_OPTIONS: --qt-binding=PyQt6 --no-opengl --low-mem
- name-suffix: "PyQt6 wheel"
os: macos-latest
python-version: "3.11"
BUILD_OPTION: --wheel
QT_BINDING: PyQt6
RUN_TESTS_OPTIONS: --qt-binding=PyQt6 --no-opencl --low-mem
- name-suffix: "No GUI wheel"
os: windows-latest
python-version: "3.9"
BUILD_COMMAND: --wheel
QT_BINDING: PyQt5
RUN_TESTS_OPTIONS: --no-gui --low-mem
# No GUI tests on Windows
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
# Install X server packages
# libegl1-mesa: Required by Qt xcb platform plugin
# ocl-icd-opencl-dev: OpenCL headers, lib and icd loader
# libgl1-mesa-glx: For OpenGL
# xserver-xorg-video-dummy: For OpenGL
# libxkbcommon-x11-0: needed for Qt plugins
- name: Install X server
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libegl1-mesa ocl-icd-opencl-dev intel-opencl-icd libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1
# Runs a single command using the runners shell
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Upgrade distribution modules
run: |
python -m pip install --upgrade pip
pip install --upgrade build setuptools wheel
pip install --upgrade --pre cython
- name: Print python info used for build
run: |
python ./ci/info_platform.py
pip list
- name: Generate source package or wheel
run: |
if [ ${{ runner.os }} == 'macOS' ]; then
export MACOSX_DEPLOYMENT_TARGET=10.9;
fi
python -m build --no-isolation ${{ matrix.BUILD_OPTION }}
ls dist
- name: Pre-install dependencies
run: |
if [ -s "ci/requirements-pinned.txt" ];
then
pip install -r ci/requirements-pinned.txt;
fi
pip install --pre -r requirements.txt
pip uninstall -y PyQt5 PyQt6 PySide6
pip install --pre "${{ matrix.QT_BINDING }}"
- name: Install pytest
run: |
pip install pytest
pip install pytest-xvfb
pip install pytest-mock
- name: Install silx package
run: pip install --pre --find-links dist/ --no-cache-dir --no-index --no-build-isolation silx
- name: Print python info used for tests
run: |
python ./ci/info_platform.py
pip list
# For Linux: Start X server with dummy video dirver
# Use this instead of Xvfb to have RANDR extension
# Otherwise there is a bug with Qt5.10.0
- name: Run the tests
run: |
if [ ${{ runner.os }} == 'Linux' ]; then
export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors
export DISPLAY=:99.0
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./99.log -config ./ci/xorg.conf :99 &
sleep 3
fi
echo "RUN_TESTS_OPTIONS="${{ matrix.RUN_TESTS_OPTIONS }}
python run_tests.py --installed -v ${{ matrix.RUN_TESTS_OPTIONS }}