Skip to content

[pre-commit.ci] pre-commit autoupdate #655

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #655

Workflow file for this run

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