66 tags : [ "**" ]
77 pull_request :
88
9- permissions :
10- contents : read
11-
129defaults :
1310 run :
1411 shell : bash
9996
10097 - run : nox --python ${{ matrix.python.action }} -e ${{ matrix.task.nox }} -- --use-wheel dist/*.whl
10198
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-
11099 - name : Codecov
111100 run : |
112- ls -al .coverage*
113- coverage combine
114101 codecov -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}"
115102
116103
@@ -150,18 +137,8 @@ jobs:
150137
151138 - run : nox --python ${{ matrix.python.action }} -e ${{ matrix.task.nox }} -- --use-wheel dist/*.whl
152139
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-
161140 - name : Codecov
162141 run : |
163- ls -al .coverage*
164- coverage combine
165142 codecov -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}"
166143
167144 check :
@@ -255,65 +232,6 @@ jobs:
255232 password : ${{ secrets.PYPI_TOKEN }}
256233 verbose : true
257234
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-
317235 # This is a meta-job to simplify PR CI enforcement configuration in GitHub.
318236 # Inside the GitHub config UI you only configure this job as required.
319237 # All the extra requirements are defined "as code" as part of the `needs`
@@ -332,9 +250,8 @@ jobs:
332250 - test-windows
333251 - check
334252 - pypi-publish
335- - coverage-report
336253 steps :
337254 - name : Require all successes
338- uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
255+ uses : re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
339256 with :
340257 jobs : ${{ toJSON(needs) }}
0 commit comments