-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (87 loc) · 3.89 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ${{ matrix.os }}
name: "${{ matrix.os }} :: ${{ matrix.python-version }} :: ${{ matrix.psychopy-version }}"
strategy:
fail-fast: false
matrix:
# test using latest available version of psychopy
os: ["ubuntu-22.04", "windows-latest"]
python-version: ["3.8", "3.9", "3.10"]
psychopy-version: ["latest"]
# additional regression tests using older versions of psychopy
include:
- os: "ubuntu-22.04"
python-version: "3.10"
psychopy-version: "2024.2.1"
- os: "ubuntu-22.04"
python-version: "3.10"
psychopy-version: "2024.1.4"
- os: "ubuntu-22.04"
python-version: "3.10"
psychopy-version: "2023.2.3"
- os: "ubuntu-22.04"
python-version: "3.10"
psychopy-version: "2023.1.3"
- os: "ubuntu-22.04"
python-version: "3.8"
psychopy-version: "2022.2.5"
- os: "ubuntu-22.04"
python-version: "3.8"
psychopy-version: "2022.1.4"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install uv
- name: Install Mesa 3D to get OpenGL support on Windows without a GPU
uses: ssciwr/setup-mesa-dist-win@v2
with:
version: "23.3.3"
- name: Linux setup
if: runner.os == 'Linux'
run: |
# various psychopy & qt system dependencies
sudo apt-get update -yy && sudo apt-get install -yy libasound2-dev portaudio19-dev libpulse-dev libusb-1.0-0-dev libsndfile1-dev libportmidi-dev liblo-dev libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0 freeglut3-dev scrot libnotify-dev pandoc libglu1-mesa-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxkbcommon-dev libxkbcommon-x11-dev '^libxcb.*-dev' gnome-screenshot
# install pre-built ubuntu/gtk3 wxPython wheel
uv pip install --system -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }}/ wxPython==4.2.1
# enable colours in logs
echo "FORCE_COLOR=1" >> $GITHUB_ENV
echo "TERM=xterm-256color" >> $GITHUB_ENV
# psychopy requires that the python executable has permission to set its priority level
sudo setcap cap_sys_nice+ep `python -c "import os; import sys; print(os.path.realpath(sys.executable))"`
# start an Xvfb server for GUI tests
nohup Xvfb :99 -screen 0 1024x768x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
# see Qt debug output when loading plugins
echo "QT_DEBUG_PLUGINS=1" >> $GITHUB_ENV
# workaround for Xlib.error.XauthError ~/.Xauthority: [Errno 2] No such file or directory
sudo touch ~/.Xauthority
- if: matrix.psychopy-version != 'latest'
run: uv pip install --system psychopy==${{ matrix.psychopy-version }} --verbose
- run: uv pip install --system -e .[tests,docs] --verbose
- run: python -m pytest --cov=vstt --cov-report=xml -v -s -x
- uses: actions/upload-artifact@v4
if: failure()
with:
name: "${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.psychopy-version }}"
path: "*.*"
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
name: ${{ matrix.os }}-${{ matrix.python-version }}
fail_ci_if_error: true
verbose: true