Repository navigation
72 lines (59 loc) · 2.2 KB
/
Copy pathtest.yml
File metadata and controls
72 lines (59 loc) · 2.2 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
# Runs the pytest suite on every supported OS and Python version.
#
# Modelled on reflectometry-lib's test.yml (same triggers, concurrency and OS
# matrix), but installed with pip: the app has no pixi environment. The suite
# is fast enough (~1-2 min) that there is no fast/slow split.
name: Code tests
on:
# Trigger the workflow on push
push:
branches-ignore: [master, main] # Already verified in PR
# But do not run this workflow on creating a new tag starting with 'v'
tags-ignore: ['v*']
# Trigger the workflow on pull request
pull_request:
branches: ['**']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
# Allow only one concurrent workflow, skipping runs queued between the run
# in-progress and latest queued. And cancel in-progress runs.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
source-test:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2022]
python-version: ['3.12', '3.13']
runs-on: ${{ matrix.os }}
env:
# No display on the runners. Only test_qml_close_behaviour.py starts a
# QGuiApplication (in a subprocess), and it needs this too.
QT_QPA_PLATFORM: offscreen
QT_QUICK_BACKEND: software
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
# Shared libraries the Qt offscreen platform plugin loads on Linux.
- name: Install Qt runtime libraries (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libgl1 libxkbcommon0 libfontconfig1 libdbus-1-3
- name: Install the app with test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
- name: Run tests
run: python -m pytest tests --color=yes -v