-
Notifications
You must be signed in to change notification settings - Fork 361
118 lines (97 loc) · 4.05 KB
/
Copy pathmain.yml
File metadata and controls
118 lines (97 loc) · 4.05 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: main
on:
push:
branches:
- main
tags:
- "*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
PYTEST_ADDOPTS: "--color=yes"
# Set permissions at the job level.
permissions: {}
jobs:
test:
runs-on: ubuntu-24.04
continue-on-error: ${{ matrix.allow_failure }}
timeout-minutes: 15
permissions:
contents: read
security-events: write
env:
TOXENV: ${{ matrix.name }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Setup mysql
if: contains(matrix.name, 'mysql')
run: |
sudo systemctl start mysql.service
echo "TEST_DB_USER=root" >> $GITHUB_ENV
echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV
- name: Setup postgresql
if: contains(matrix.name, 'postgres')
run: |
sudo systemctl start postgresql.service
sudo -u postgres createuser --createdb $USER
- name: Install dependencies
run: |
python -m pip install uv
uv tool install tox==4.28.4 --with tox-uv
- name: Run tox
run: tox
- name: Upload zizmor SARIF report into the GitHub repo code scanning
if: contains(matrix.name, 'linting')
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: zizmor.sarif
category: zizmor
- name: Report coverage
if: contains(matrix.name, 'coverage')
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- {name: 'linting,docs', python: '3.14', allow_failure: false}
# Django 5.2 LTS / Python 3.10–3.14
- {name: py310-dj52-mysql-coverage, python: '3.10', allow_failure: false}
- {name: py311-dj52-sqlite-xdist-coverage, python: '3.11', allow_failure: false}
- {name: py311-dj52-mysql-coverage, python: '3.11', allow_failure: false}
- {name: py312-dj52-postgres-xdist-coverage, python: '3.12', allow_failure: false}
- {name: py313-dj52-sqlite-coverage, python: '3.13', allow_failure: false}
- {name: py314-dj52-postgres-xdist-coverage, python: '3.14', allow_failure: false}
# Django 6.0 / Python 3.12–3.14
- {name: py312-dj60-postgres-xdist-coverage, python: '3.12', allow_failure: false}
- {name: py313-dj60-sqlite-coverage, python: '3.13', allow_failure: false}
- {name: py314-dj60-postgres-xdist-coverage, python: '3.14', allow_failure: false}
- {name: py314t-dj60-postgres-xdist-coverage, python: '3.14t', allow_failure: false}
# Pin the minimum supported pytest on the latest stable combo.
- {name: py313-dj60-sqlite-pytestmin-coverage, python: '3.13', allow_failure: false}
# Django main / Python [latest]
- {name: py313-djmain-sqlite-coverage, python: '3.13', allow_failure: true}
- {name: py314-djmain-postgres-xdist-coverage, python: '3.14', allow_failure: true}
- {name: py314t-djmain-postgres-xdist-coverage, python: '3.14t', allow_failure: true}
# PyPy: one representative combo, no coverage (too slow)
- {name: pypy3-dj52-postgres, python: 'pypy3.10', allow_failure: false}
check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- test
runs-on: ubuntu-24.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@2765efec08f0fd63e83ad900f5fd75646be69ff6
with:
jobs: ${{ toJSON(needs) }}