11name : CI
22
33on :
4- # Triggers the workflow on push only for the master branch or pull request events
54 push :
6- branches : [master ]
5+ branches : [main ]
76 pull_request :
8-
9- # Allows you to run this workflow manually from the Actions tab
107 workflow_dispatch :
118
129defaults :
@@ -16,134 +13,89 @@ defaults:
1613jobs :
1714 # This workflow contains a single job called "build"
1815 build :
19- name : " Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.name-suffix }}"
16+ name : " Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.QT_API }}"
2017 runs-on : ${{ matrix.os }}
2118 strategy :
19+ fail-fast : false
2220 matrix :
2321 include :
24- - name-suffix : " PyQt5 sdist"
25- os : ubuntu-20.04
22+ - os : ubuntu-20.04
2623 python-version : " 3.8"
27- BUILD_OPTION : --sdist
28- QT_BINDING : PyQt5
29- RUN_TESTS_OPTIONS : --qt-binding=PyQt5 --no-opencl --low-mem
30- - name-suffix : " PyQt5 wheel"
31- os : macos-latest
32- python-version : " 3.10"
33- BUILD_OPTION : --wheel
34- QT_BINDING : PyQt5
35- RUN_TESTS_OPTIONS : --qt-binding=PyQt5 --no-opencl --low-mem
24+ QT_API : PyQt5
25+ - os : ubuntu-latest
26+ python-version : " 3.11"
27+ QT_API : PyQt6
28+ - os : ubuntu-latest
29+ python-version : " 3.12"
30+ QT_API : PySide6
3631
37- - name-suffix : " PySide6 sdist"
38- os : ubuntu-latest
39- python-version : " 3.8"
40- BUILD_OPTION : --sdist
41- QT_BINDING : PySide6
42- RUN_TESTS_OPTIONS : --qt-binding=PySide6 --no-opencl --low-mem
43- - name-suffix : " PySide6 wheel"
44- os : macos-latest
32+ - os : macos-13
33+ python-version : " 3.10"
34+ QT_API : PyQt5
35+ - os : macos-13
36+ python-version : " 3.12"
37+ QT_API : PyQt6
38+ - os : macos-13
4539 python-version : " 3.9"
46- BUILD_OPTION : --wheel
47- QT_BINDING : " PySide6<6.7"
48- RUN_TESTS_OPTIONS : --qt-binding=PySide6 --no-opencl --low-mem
40+ QT_API : PySide6
4941
50- - name-suffix : " PyQt6 wheel"
51- os : ubuntu-latest
52- python-version : " 3.11"
53- BUILD_OPTION : --wheel
54- QT_BINDING : PyQt6
55- RUN_TESTS_OPTIONS : --qt-binding=PyQt6 --no-opengl --low-mem
56- - name-suffix : " PyQt6 wheel"
57- os : macos-latest
58- python-version : " 3.11"
59- BUILD_OPTION : --wheel
60- QT_BINDING : PyQt6
61- RUN_TESTS_OPTIONS : --qt-binding=PyQt6 --no-opencl --low-mem
62-
63- - name-suffix : " No GUI wheel"
64- os : windows-latest
42+ - os : windows-latest
6543 python-version : " 3.9"
66- BUILD_COMMAND : --wheel
67- QT_BINDING : PyQt5
68- RUN_TESTS_OPTIONS : --no-gui --low-mem
69- # No GUI tests on Windows
44+ QT_API : PyQt5
45+ - os : windows-latest
46+ python-version : " 3.12"
47+ QT_API : PyQt6
48+ - os : windows-latest
49+ python-version : " 3.10"
50+ QT_API : PySide6
7051
71- # Steps represent a sequence of tasks that will be executed as part of the job
7252 steps :
7353 - uses : actions/checkout@v4
7454
75- # Install X server packages
55+ # Install packages:
56+ # OpenCL lib and icd
57+ # xvfb to run the GUI test headless
7658 # libegl1-mesa: Required by Qt xcb platform plugin
77- # ocl-icd-opencl-dev: OpenCL headers, lib and icd loader
7859 # libgl1-mesa-glx: For OpenGL
7960 # xserver-xorg-video-dummy: For OpenGL
80- # libxkbcommon-x11-0: needed for Qt plugins
81- - name : Install X server
61+ # libxkbcommon-x11-0, .. : needed for Qt plugins
62+ - name : Install system packages
8263 if : runner.os == 'Linux'
8364 run : |
8465 sudo apt-get update
85- 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
66+ sudo apt-get install ocl-icd-opencl-dev intel-opencl-icd xvfb libegl1-mesa 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
8667
87- # Runs a single command using the runners shell
88- - name : Set up Python
89- uses : actions/setup-python@v5
68+ - uses : actions/setup-python@v5
9069 with :
9170 python-version : ${{ matrix.python-version }}
9271 cache : " pip"
9372
94- - name : Upgrade distribution modules
73+ - name : Install build dependencies
9574 run : |
96- python -m pip install --upgrade pip
97- pip install --upgrade build setuptools wheel
98- pip install --upgrade --pre cython
99-
100- - name : Print python info used for build
101- run : |
102- python ./ci/info_platform.py
75+ pip install --upgrade --pre build cython setuptools wheel
10376 pip list
10477
105- - name : Generate source package or wheel
78+ - name : Build
79+ env :
80+ MACOSX_DEPLOYMENT_TARGET : " 10.9"
10681 run : |
107- if [ ${{ runner.os }} == 'macOS' ]; then
108- export MACOSX_DEPLOYMENT_TARGET=10.9;
109- fi
110- python -m build --no-isolation ${{ matrix.BUILD_OPTION }}
82+ python -m build --no-isolation
11183 ls dist
11284
113- - name : Pre-install dependencies
114- run : |
115- if [ -s "ci/requirements-pinned.txt" ];
116- then
117- pip install -r ci/requirements-pinned.txt;
118- fi
119- pip install --pre -r requirements.txt
120- pip uninstall -y PyQt5 PyQt6 PySide6
121- pip install --pre "${{ matrix.QT_BINDING }}"
122-
123- - name : Install pytest
124- run : |
125- pip install pytest
126- pip install pytest-xvfb
127- pip install pytest-mock
128-
129- - name : Install silx package
130- run : pip install --pre --find-links dist/ --no-cache-dir --no-index --no-build-isolation silx
131-
132- - name : Print python info used for tests
85+ - name : Install
13386 run : |
87+ pip install -r ci/requirements-pinned.txt
88+ pip install --pre "${{ matrix.QT_API }}"
89+ pip install --pre "$(ls dist/silx*.whl)[full,test]"
13490 python ./ci/info_platform.py
13591 pip list
13692
137- # For Linux: Start X server with dummy video dirver
138- # Use this instead of Xvfb to have RANDR extension
139- # Otherwise there is a bug with Qt5.10.0
140- - name : Run the tests
93+ - name : Test
94+ env :
95+ QT_API : ${{ matrix.QT_API }}
96+ SILX_TEST_LOW_MEM : " False "
14197 run : |
142- if [ ${{ runner.os }} == 'Linux' ]; then
143- export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors
144- export DISPLAY=:99.0
145- Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./99.log -config ./ci/xorg.conf :99 &
146- sleep 3
98+ if [ ${{ runner.os }} == 'Windows' ]; then
99+ export WITH_GL_TEST=False
147100 fi
148- echo "RUN_TESTS_OPTIONS="${{ matrix.RUN_TESTS_OPTIONS }}
149- python run_tests.py --installed -v ${{ matrix.RUN_TESTS_OPTIONS }}
101+ python -c "import silx.test, sys; sys.exit(silx.test.run_tests(verbosity=1, args=['--qt-binding=${{ matrix.QT_API }}']));"
0 commit comments