-
Notifications
You must be signed in to change notification settings - Fork 3.4k
64 lines (62 loc) · 1.81 KB
/
python-unit-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
60
61
62
63
64
name: Python Unit Tests
on:
pull_request:
branches: ["main", "feature*"]
paths:
- "python/**"
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
jobs:
python-unit-tests:
name: Python Unit Tests
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
experimental: [false]
# include:
# - python-version: "3.13"
# os: "ubuntu-latest"
# experimental: true
# - python-version: "3.13t"
# os: "ubuntu-latest"
# experimental: true
# gil: 0
# - python-version: "3.13t"
# os: "ubuntu-latest"
# experimental: true
# gil: 1
env:
UV_PYTHON: ${{ matrix.python-version }}
permissions:
contents: write
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.x"
enable-cache: true
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev -U --prerelease=if-necessary-or-explicit
- name: Test with pytest
env:
PYTHON_GIL: ${{ matrix.gil }}
run: uv run --frozen pytest --junitxml=pytest.xml ./tests/unit
- name: Surface failing tests
if: ${{ !matrix.experimental }}
uses: pmeier/pytest-results-action@main
with:
path: python/pytest.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results