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