-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (59 loc) · 1.5 KB
/
tests.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
name: Tests
on:
push:
branches:
- main
- "**"
paths-ignore:
- "docs/**"
- "*.md"
- "*.rst"
- "*.txt"
pull_request:
branches:
- main
- "*.x"
paths-ignore:
- "docs/**"
- "*.md"
- "*.rst"
- "*.txt"
jobs:
tests:
name: ${{ matrix.platform.name }} Python ${{ matrix.python }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
name: Linux
- os: macos-latest
name: MacOS
- os: windows-latest
name: Windows
python:
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- name: Install and cache Linux packages
if: ${{ runner.os == 'Linux' }}
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils qtbase5-dev qt5-qmake libpugixml1v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.12"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install Python and dependencies
run: |
uv python install ${{ matrix.python }}
uv venv
uv pip install .[test]
- name: Run tests
run: |
${{ (runner.os == 'Windows' && 'echo "Activating environment" && .venv\Scripts\activate') || 'echo "Activating environment" &&source .venv/bin/activate' }}
pytest -n auto tests/