|
70 | 70 | DB_PASSWORD: debug_toolbar |
71 | 71 | DB_HOST: 127.0.0.1 |
72 | 72 | DB_PORT: 3306 |
| 73 | + COVERAGE_FILE: ".coverage.mysql.${{ matrix.python_version }}" |
| 74 | + |
| 75 | + - name: Store coverage file |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: coverage-mysql-${{ matrix.python_version }} |
| 79 | + path: .coverage.mysql.${{ matrix.python_version }} |
| 80 | + include-hidden-files: true |
73 | 81 |
|
74 | 82 |
|
75 | 83 | postgres: |
@@ -163,6 +171,14 @@ jobs: |
163 | 171 | DB_HOST: localhost |
164 | 172 | DB_PORT: 5432 |
165 | 173 | DJANGO_SELENIUM_TESTS: ${{ matrix.env.DJANGO_SELENIUM_TESTS }} |
| 174 | + COVERAGE_FILE: ".coverage.postgres.${{ matrix.python_version }}" |
| 175 | + |
| 176 | + - name: Store coverage file |
| 177 | + uses: actions/upload-artifact@v4 |
| 178 | + with: |
| 179 | + name: coverage-postgres-${{ matrix.python_version }} |
| 180 | + path: .coverage.postgres.${{ matrix.python_version }} |
| 181 | + include-hidden-files: true |
166 | 182 |
|
167 | 183 | sqlite: |
168 | 184 | runs-on: ubuntu-latest |
@@ -207,6 +223,14 @@ jobs: |
207 | 223 | env: |
208 | 224 | DB_BACKEND: sqlite3 |
209 | 225 | DB_NAME: ":memory:" |
| 226 | + COVERAGE_FILE: ".coverage.sqlite.${{ matrix.python_version }}" |
| 227 | + |
| 228 | + - name: Store coverage file |
| 229 | + uses: actions/upload-artifact@v4 |
| 230 | + with: |
| 231 | + name: coverage-sqlite-${{ matrix.python_version }} |
| 232 | + path: .coverage.sqlite.${{ matrix.python_version }} |
| 233 | + include-hidden-files: true |
210 | 234 |
|
211 | 235 | lint: |
212 | 236 | runs-on: ubuntu-latest |
@@ -244,3 +268,38 @@ jobs: |
244 | 268 |
|
245 | 269 | - name: Test with tox |
246 | 270 | run: tox -e docs,packaging |
| 271 | + |
| 272 | + coverage: |
| 273 | + name: Coverage |
| 274 | + runs-on: ubuntu-latest |
| 275 | + needs: |
| 276 | + - mysql |
| 277 | + - postgres |
| 278 | + - sqlite |
| 279 | + permissions: |
| 280 | + pull-requests: write |
| 281 | + contents: write |
| 282 | + steps: |
| 283 | + - uses: actions/checkout@v4 |
| 284 | + with: |
| 285 | + persist-credentials: false |
| 286 | + |
| 287 | + - uses: actions/download-artifact@v4 |
| 288 | + id: download |
| 289 | + with: |
| 290 | + pattern: coverage-* |
| 291 | + merge-multiple: true |
| 292 | + |
| 293 | + - name: Coverage comment |
| 294 | + id: coverage_comment |
| 295 | + uses: py-cov-action/python-coverage-comment-action@6494290850a5098c2836298dad8f11082b4ceaa9 # v3 |
| 296 | + with: |
| 297 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 298 | + MERGE_COVERAGE_FILES: true |
| 299 | + |
| 300 | + - name: Store Pull Request comment to be posted |
| 301 | + uses: actions/upload-artifact@v4 |
| 302 | + if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' |
| 303 | + with: |
| 304 | + name: python-coverage-comment-action |
| 305 | + path: python-coverage-comment-action.txt |
0 commit comments