-
Notifications
You must be signed in to change notification settings - Fork 131
71 lines (65 loc) · 2.14 KB
/
Copy pathtests.yml
File metadata and controls
71 lines (65 loc) · 2.14 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
# For documentation on GitHub Actions Workflows, see:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Tests
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15-dev"]
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v7.0.1
with:
fetch-depth: 0 # Needed for setuptools_scm to work correctly
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install the project
run: uv sync --no-default-groups --group test
- name: Run tests
run:
uv run --no-default-groups --group test python -Xutf8 -m pytest --cov
--cov-config=pyproject.toml --cov-report=xml tests
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
flags: python${{ matrix.python-version }}
name: codecov-umbrella-test-results
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
# Single stable status check for the whole test matrix, so branch protection
# doesn't need updating every time the OS/Python matrix changes.
all-tests-passed:
name: All Tests Passed
if: always()
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: Fail if any matrix job did not succeed
if: needs.tests.result != 'success'
run: exit 1