-
Notifications
You must be signed in to change notification settings - Fork 87
77 lines (68 loc) · 2.65 KB
/
run-tests.yml
File metadata and controls
77 lines (68 loc) · 2.65 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
# This workflow will install pydm dependencies and run the test suite for all combinations
# of operating systems and version numbers specified in the matrix
name: Build Status
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
if: ${{ github.repository == 'slaclab/pydm' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.10']
pyqt-version: [5.15.9]
env:
DISPLAY: ':99.0'
QT_MAC_WANTS_LAYER: 1 # PyQT gui tests involving qtbot interaction on macOS will fail without this
steps:
- uses: actions/checkout@v4
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Miniforge3
miniforge-version: latest
activate-environment: pydm-env
conda-remove-defaults: true
architecture: x64 # Ensure macOS finds PyQt 5.12.3 which isn't available with osx-arm64
- name: Install PyDM with Mamba
shell: bash -el {0}
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
conda install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }}
elif [ "$RUNNER_OS" == "macOS" ]; then
mamba install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }} git p4p pyca
else
mamba install -c conda-forge pydm pyqt=${{ matrix.pyqt-version }}
fi
- name: Install additional Python dependencies with pip
shell: bash -el {0}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
pip install .[test]
else
pip install .[test-no-optional]
fi
- name: Install packages for testing a PyQt app on Linux
shell: bash -el {0}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install -y xvfb herbstluftwm libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
sleep 3
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_herbstluftwm_99.pid --make-pidfile --background --exec /usr/bin/herbstluftwm
sleep 1
fi
- name: Test with pytest
shell: bash -el {0}
timeout-minutes: 50 # timeout applies to single run of run_tests.py, not all os/python combos
run: |
python run_tests.py -s