Skip to content

Commit 4f7413d

Browse files
committed
intra-gha combined coverage
1 parent 50c723a commit 4f7413d

File tree

4 files changed

+64
-3
lines changed

4 files changed

+64
-3
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
mkdir coverage_reports
138138
cp .coverage "coverage_reports/coverage.${{ env.JOB_NAME }}"
139139
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_NAME }}.xml"
140-
- name: Publish Coverage
140+
- name: Upload Coverage
141141
if: matrix.task.coverage
142142
uses: actions/upload-artifact@v2
143143
with:
@@ -190,12 +190,66 @@ jobs:
190190
continue-on-error: ${{ matrix.task.continue_on_error }}
191191
run: |
192192
tox -vv -e ${{ matrix.task.tox }}
193+
coverage:
194+
# Should match JOB_NAME below
195+
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.qt_library.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
196+
runs-on: ${{ matrix.os.runs-on }}
197+
needs:
198+
- test
199+
container: ${{ matrix.os.container[matrix.python.docker] }}
200+
strategy:
201+
fail-fast: false
202+
matrix:
203+
task:
204+
- name: Coverage
205+
tox: combined-coverage
206+
download_coverage: true
207+
os:
208+
- name: Linux
209+
runs-on: ubuntu-latest
210+
python_platform: linux
211+
matrix: linux
212+
container:
213+
3.8: docker://python:3.8-buster
214+
python:
215+
- name: CPython 3.8
216+
tox: py38
217+
action: 3.8
218+
docker: 3.8
219+
implementation: cpython
220+
arch:
221+
- name: x64
222+
action: x64
223+
matrix: x64
224+
env:
225+
# Should match name above
226+
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.qt_library.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
227+
steps:
228+
- uses: actions/checkout@v2
229+
with:
230+
fetch-depth: 0
231+
- name: Install
232+
run: |
233+
pip install --upgrade pip setuptools wheel
234+
pip install --upgrade tox
235+
- uses: twisted/[email protected]
236+
- name: Download Coverage
237+
if: matrix.task.download_coverage
238+
uses: actions/download-artifact@v2
239+
with:
240+
name: coverage
241+
path: coverage_reports
242+
- name: Test
243+
continue-on-error: ${{ matrix.task.continue_on_error }}
244+
run: |
245+
tox -vv -e ${{ matrix.task.tox }}
193246
all:
194247
name: All
195248
runs-on: ubuntu-latest
196249
needs:
197-
- test
198250
- check
251+
- coverage
252+
- test
199253
steps:
200254
- name: This
201255
shell: python

requirements-coverage.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage >= 4.2

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
bcrypt>=3.1.6
22
capturer >= 2.2
3-
coverage >= 4.2
3+
-r requirements-coverage.txt
44
cryptography>= 2.3
55
mock >= 1.0.1
66
pyserial-asyncio>=0.4.0;python_version>="3.4"

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ commands =
2626
make -C doc/ clean
2727
make -C doc/ html
2828

29+
[testenv:combined-coverage]
30+
deps = -r requirements-coverage.txt
31+
commands =
32+
coverage combine coverage_reports
33+
coverage report --fail-under=90 --ignore-errors
34+
2935
[flake8]
3036
exclude = .tox
3137
ignore = D211,D400,E731

0 commit comments

Comments
 (0)