-
-
Notifications
You must be signed in to change notification settings - Fork 78
95 lines (92 loc) · 2.73 KB
/
test_suite.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: test suite
on:
push:
branches:
- master
pull_request:
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
django-version:
- "4.2"
- "5.0"
- "5.1"
exclude:
- django-version: 4.2
python-version: 3.12
- django-version: 4.2
python-version: 3.13
- django-version: 5.0
python-version: 3.9
- django-version: 5.1
python-version: 3.9
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
cache-suffix: ${{ matrix.python-version }}
- name: Install Python
run: uv python install ${{ matrix.python-version }}
env:
UV_PYTHON_PREFERENCE: only-managed
- run: uv sync --all-groups
- run: uv run --with 'django~=${{ matrix.django-version }}.0' pytest --cov --cov-report=
env:
DJANGO_SETTINGS_MODULE: tests.settings
PYTHONPATH: "."
- name: Rename coverage file
run: mv .coverage .coverage.py${{ matrix.python-version }}.dj${{ matrix.django-version }}
- name: Save coverage file
uses: actions/upload-artifact@v4
with:
name: .coverage.py${{ matrix.python-version }}.dj${{ matrix.django-version }}
path: .coverage.py${{ matrix.python-version }}.dj${{ matrix.django-version }}
include-hidden-files: true
codecov:
needs: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv python install 3.13
- uses: actions/download-artifact@v4
with:
pattern: .coverage.*
merge-multiple: true
- name: Combine coverage
run: |
uv run coverage combine
uv run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
lint: # redundant with pre-commit-ci, but we want to make the linters a part of strict status checks.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv python install 3.13
- run: uv sync --group dev
- run: uvx ruff check
- run: uvx ruff format --check
check:
runs-on: ubuntu-latest
if: always()
needs:
- pytest
- lint
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}