Skip to content

Commit 8830c20

Browse files
committed
Centralize GH Actions test workflows in one workflow file
1 parent 35df380 commit 8830c20

File tree

3 files changed

+45
-120
lines changed

3 files changed

+45
-120
lines changed

.github/workflows/macos-tests.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux tests
1+
name: Run tests
22

33
on:
44
push:
@@ -10,36 +10,68 @@ on:
1010
workflow_dispatch:
1111

1212
concurrency:
13-
group: linux-tests-${{ github.ref }}
13+
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

1616
jobs:
17-
linux:
18-
name: Linux Py${{ matrix.PYTHON_VERSION }} - ${{ matrix.INSTALL_TYPE }} - ${{ matrix.QT_LIB }}
19-
runs-on: ubuntu-latest
17+
test:
18+
name: ${{ matrix.RUNNER_OS }} Py${{ matrix.PYTHON_VERSION }} - ${{ matrix.INSTALL_TYPE }} - ${{ matrix.QT_LIB }}
19+
runs-on: ${{ matrix.RUNNER_OS }}-latest
20+
timeout-minutes: 15
2021
env:
2122
CI: True
2223
QTCONSOLE_TESTING: True
2324
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
24-
RUNNER_OS: 'ubuntu'
25+
RUNNER_OS: ${{ matrix.RUNNER_OS }}
26+
INSTALL_TYPE: ${{ matrix.INSTALL_TYPE }}
27+
QT_API: ${{ matrix.QT_LIB }}
28+
PYTEST_QT_API: ${{ matrix.QT_LIB }}
2529
COVERALLS_REPO_TOKEN: XWVhJf2AsO7iouBLuCsh0pPhwHy81Uz1v
2630
COVERALLS_SERVICE_NAME: 'github-actions'
2731
strategy:
2832
fail-fast: false
2933
matrix:
34+
RUNNER_OS: ['ubuntu', 'windows', 'macos']
3035
PYTHON_VERSION: ['3.9', '3.10', '3.11', '3.12', '3.13']
3136
INSTALL_TYPE: ['conda', 'pip']
3237
QT_LIB: ['pyqt5', 'pyqt6']
38+
include:
39+
- RUNNER_OS: 'ubuntu'
40+
- SPECIAL_INVOCATION: 'xvfb-run --auto-servernum '
3341
exclude:
34-
- INSTALL_TYPE: 'conda'
42+
# Disable unsupported configurations
43+
- RUNNER_OS: 'ubuntu'
44+
INSTALL_TYPE: 'conda'
3545
QT_LIB: 'pyqt6'
36-
- INSTALL_TYPE: 'conda'
46+
- RUNNER_OS: 'ubuntu'
47+
INSTALL_TYPE: 'conda'
3748
PYTHON_VERSION: '3.8'
38-
timeout-minutes: 15
49+
# Prune the number of matrix jobs
50+
- RUNNER_OS: 'windows'
51+
PYTHON_VERSION: '3.10'
52+
- RUNNER_OS: 'windows'
53+
PYTHON_VERSION: '3.11'
54+
- RUNNER_OS: 'windows'
55+
PYTHON_VERSION: '3.13'
56+
- RUNNER_OS: 'windows'
57+
INSTALL_TYPE: 'pip'
58+
- RUNNER_OS: 'windows'
59+
QT_LIB: 'pyqt6'
60+
- RUNNER_OS: 'macos'
61+
PYTHON_VERSION: '3.10'
62+
- RUNNER_OS: 'macos'
63+
PYTHON_VERSION: '3.11'
64+
- RUNNER_OS: 'macos'
65+
PYTHON_VERSION: '3.13'
66+
- RUNNER_OS: 'macos'
67+
INSTALL_TYPE: 'pip'
68+
- RUNNER_OS: 'macos'
69+
QT_LIB: 'pyqt6'
3970
steps:
4071
- name: Checkout branch
4172
uses: actions/checkout@v3
42-
- name: Install System Packages
73+
- name: Install Linux packages
74+
if: matrix.RUNNER_OS == 'ubuntu'
4375
run: |
4476
sudo apt-get update
4577
sudo apt-get install -y --no-install-recommends '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1
@@ -54,11 +86,11 @@ jobs:
5486
channels: conda-forge
5587
channel-priority: true
5688
python-version: ${{ matrix.PYTHON_VERSION }}
57-
- name: Install dependencies with conda
89+
- name: Install dependencies with Mamba
5890
if: matrix.INSTALL_TYPE == 'conda'
5991
shell: bash -el {0}
6092
run: mamba env update --file requirements/environment.yml
61-
- name: Install dependencies with pip
93+
- name: Install dependencies with Pip
6294
if: matrix.INSTALL_TYPE == 'pip'
6395
shell: bash -el {0}
6496
run: |
@@ -76,10 +108,7 @@ jobs:
76108
pip list
77109
- name: Run tests
78110
shell: bash -el {0}
79-
run: xvfb-run --auto-servernum pytest -vv -s --full-trace --color=yes --cov=qtconsole qtconsole
80-
env:
81-
QT_API: ${{ matrix.QT_LIB }}
82-
PYTEST_QT_API: ${{ matrix.QT_LIB }}
111+
run: ${{ matrix.SPECIAL_INVOCATION }}pytest -vv -s --full-trace --color=yes --cov=qtconsole qtconsole
83112
- name: Upload coverage to coveralls
84113
if: matrix.PYTHON_VERSION == '3.8'
85114
shell: bash -el {0}

.github/workflows/windows-tests.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)