6
6
tags : [ "**" ]
7
7
pull_request :
8
8
9
- permissions :
10
- contents : read
11
-
12
9
defaults :
13
10
run :
14
11
shell : bash
99
96
100
97
- run : nox --python ${{ matrix.python.action }} -e ${{ matrix.task.nox }} -- --use-wheel dist/*.whl
101
98
102
- - name : Store coverage file
103
- uses : actions/upload-artifact@v3
104
- with :
105
- name : coverage
106
- # It is important to keep the unique names for the coverage files
107
- # so that when uploaded to the same artifact, they don't overlap.
108
- path : .coverage*
109
-
110
99
- name : Codecov
111
100
run : |
112
- ls -al .coverage*
113
- coverage combine
114
101
codecov -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}"
115
102
116
103
@@ -150,18 +137,8 @@ jobs:
150
137
151
138
- run : nox --python ${{ matrix.python.action }} -e ${{ matrix.task.nox }} -- --use-wheel dist/*.whl
152
139
153
- - name : Store coverage file
154
- uses : actions/upload-artifact@v3
155
- with :
156
- name : coverage
157
- # It is important to keep the unique names for the coverage files
158
- # so that when uploaded to the same artifact, they don't overlap.
159
- path : .coverage*
160
-
161
140
- name : Codecov
162
141
run : |
163
- ls -al .coverage*
164
- coverage combine
165
142
codecov -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}"
166
143
167
144
check :
@@ -255,65 +232,6 @@ jobs:
255
232
password : ${{ secrets.PYPI_TOKEN }}
256
233
verbose : true
257
234
258
- coverage-report :
259
- name : Coverage report
260
- runs-on : ubuntu-latest
261
- permissions :
262
- # Even we send a comment to a PR, we use the issues API.
263
- # Issues and PR share the same comment API.
264
- issues : write
265
- needs :
266
- # We are waiting only for test jobs.
267
- - test-linux
268
- - test-windows
269
- steps :
270
- - uses : actions/checkout@v3
271
- with :
272
- fetch-depth : 0
273
-
274
- - name : Install dependencies
275
- run : |
276
- python -m pip install --upgrade pip
277
- python -m pip install --upgrade coverage[toml] diff_cover
278
-
279
- - name : Download coverage reports
280
- uses : actions/download-artifact@v3
281
- with :
282
- name : coverage
283
- path : .
284
-
285
- - name : Combine coverage
286
- run : coverage combine
287
-
288
- - name : Report coverage
289
- run : |
290
- coverage xml
291
- coverage report --no-skip-covered --show-missing
292
- # Wrap output in markdown verbatim text.
293
- echo '```' > coverage-report.txt
294
- coverage report --show-missing >> coverage-report.txt
295
- echo '```' >> coverage-report.txt
296
- diff-cover --markdown-report diff-cover.md --compare-branch origin/trunk coverage.xml
297
- cat diff-cover.md >> coverage-report.txt
298
-
299
- # Use the generic JS script to call our custom script
300
- # for sending a comment to a PR.
301
- - name : Send coverage comment to PR
302
- uses : actions/github-script@v3
303
- env :
304
- COMMENT_MARKER : " <!--- automatic-coverage-report -->"
305
- COMMENT_BODY : coverage-report.txt
306
- with :
307
- script : |
308
- const script = require(`${process.env.GITHUB_WORKSPACE}/.github/scripts/pr_comment.js`)
309
- // Only pass top level objects as GHA does dependecy injection.
310
- await script({github, context, process})
311
-
312
- - name : Enforce diff coverage
313
- run : |
314
- diff-cover --fail-under=100 --compare-branch origin/trunk coverage.xml
315
-
316
-
317
235
# This is a meta-job to simplify PR CI enforcement configuration in GitHub.
318
236
# Inside the GitHub config UI you only configure this job as required.
319
237
# All the extra requirements are defined "as code" as part of the `needs`
@@ -332,9 +250,8 @@ jobs:
332
250
- test-windows
333
251
- check
334
252
- pypi-publish
335
- - coverage-report
336
253
steps :
337
254
- name : Require all successes
338
- uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
255
+ uses : re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
339
256
with :
340
257
jobs : ${{ toJSON(needs) }}
0 commit comments