Skip to content

Commit f9c99f8

Browse files
authored
oopss
1 parent cdfa454 commit f9c99f8

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed

.github/workflows/main.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: main
2+
3+
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- "*"
11+
pull_request:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
17+
env:
18+
PYTEST_ADDOPTS: "--color=yes"
19+
20+
# Set permissions at the job level.
21+
permissions: {}
22+
23+
jobs:
24+
test:
25+
runs-on: ubuntu-24.04
26+
continue-on-error: ${{ matrix.allow_failure }}
27+
timeout-minutes: 15
28+
permissions:
29+
contents: read
30+
security-events: write
31+
env:
32+
TOXENV: ${{ matrix.name }}
33+
steps:
34+
- uses: actions/checkout@v5
35+
with:
36+
persist-credentials: false
37+
38+
- uses: actions/setup-python@v6
39+
with:
40+
python-version: ${{ matrix.python }}
41+
42+
- name: Setup mysql
43+
if: contains(matrix.name, 'mysql')
44+
run: |
45+
sudo systemctl start mysql.service
46+
echo "TEST_DB_USER=root" >> $GITHUB_ENV
47+
echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV
48+
- name: Setup postgresql
49+
if: contains(matrix.name, 'postgres')
50+
run: |
51+
sudo systemctl start postgresql.service
52+
sudo -u postgres createuser --createdb $USER
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install uv
56+
uv tool install tox==4.28.4 --with tox-uv
57+
- name: Run tox
58+
run: tox
59+
60+
- name: Upload zizmor SARIF report into the GitHub repo code scanning
61+
if: contains(matrix.name, 'linting')
62+
uses: github/codeql-action/upload-sarif@v4
63+
with:
64+
sarif_file: zizmor.sarif
65+
category: zizmor
66+
67+
- name: Report coverage
68+
if: contains(matrix.name, 'coverage')
69+
uses: codecov/codecov-action@v5
70+
with:
71+
fail_ci_if_error: true
72+
files: ./coverage.xml
73+
token: ${{ secrets.CODECOV_TOKEN }}
74+
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
include:
79+
- name: linting,docs
80+
python: '3.13'
81+
allow_failure: false
82+
83+
# Explicitly test min pytest.
84+
- name: py313-dj52-sqlite-pytestmin-coverage
85+
python: '3.13'
86+
allow_failure: false
87+
88+
- name: py314-djmain-postgres-xdist-coverage
89+
python: '3.14'
90+
allow_failure: true
91+
92+
- name: py314-dj52-postgres-xdist-coverage
93+
python: '3.14'
94+
allow_failure: false
95+
96+
- name: py313-dj52-postgres-xdist-coverage
97+
python: '3.13'
98+
allow_failure: false
99+
100+
- name: py313-dj51-postgres-xdist-coverage
101+
python: '3.13'
102+
allow_failure: false
103+
104+
- name: py312-dj42-postgres-xdist-coverage
105+
python: '3.12'
106+
allow_failure: false
107+
108+
- name: py311-dj50-postgres-xdist-coverage
109+
python: '3.11'
110+
allow_failure: false
111+
112+
- name: py311-dj42-postgres-xdist-coverage
113+
python: '3.11'
114+
allow_failure: false
115+
116+
- name: py310-dj52-postgres-xdist-coverage
117+
python: '3.10'
118+
allow_failure: false
119+
120+
- name: py310-dj51-postgres-xdist-coverage
121+
python: '3.10'
122+
allow_failure: false
123+
124+
- name: py310-dj42-postgres-xdist-coverage
125+
python: '3.10'
126+
allow_failure: false
127+
128+
- name: py311-dj51-mysql-coverage
129+
python: '3.11'
130+
allow_failure: false
131+
132+
- name: py310-dj42-mysql-coverage
133+
python: '3.10'
134+
allow_failure: false
135+
136+
- name: py313-djmain-sqlite-coverage
137+
python: '3.13'
138+
allow_failure: true
139+
140+
- name: py313-dj52-sqlite-coverage
141+
python: '3.13'
142+
allow_failure: false
143+
144+
- name: py312-dj51-sqlite-xdist-coverage
145+
python: '3.12'
146+
allow_failure: false
147+
148+
- name: py311-dj42-sqlite-xdist-coverage
149+
python: '3.11'
150+
allow_failure: false
151+
152+
# pypy3: not included with coverage reports (much slower then).
153+
- name: pypy3-dj42-postgres
154+
python: 'pypy3.10'
155+
allow_failure: false
156+
157+
check: # This job does nothing and is only used for the branch protection
158+
if: always()
159+
160+
needs:
161+
- test
162+
163+
runs-on: ubuntu-24.04
164+
165+
steps:
166+
- name: Decide whether the needed jobs succeeded or failed
167+
uses: re-actors/alls-green@2765efec08f0fd63e83ad900f5fd75646be69ff6
168+
with:
169+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)