Skip to content

Commit d7773b7

Browse files
combine coverage data and upload a html report (elastic#1800)
* combine coverage data and upload a html report * Update .github/workflows/test.yml Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com> --------- Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com>
1 parent 33d0f11 commit d7773b7

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,42 @@ jobs:
140140
- windows
141141
steps:
142142
- run: test $(echo '${{ toJSON(needs) }}' | jq -s 'map(.[].result) | all(.=="success")') = 'true'
143+
144+
coverage:
145+
name: Combine & check coverage.
146+
needs: all
147+
runs-on: ubuntu-latest
148+
149+
steps:
150+
- uses: actions/checkout@v3
151+
152+
- uses: actions/setup-python@v4
153+
with:
154+
# Use latest Python, so it understands all syntax.
155+
python-version: 3.11
156+
157+
- run: python -Im pip install --upgrade coverage[toml]
158+
159+
- uses: actions/download-artifact@v3
160+
with:
161+
name: coverage-reports
162+
163+
- name: Combine coverage & fail if it's <84%.
164+
run: |
165+
python -Im coverage combine
166+
python -Im coverage html --skip-covered --skip-empty
167+
168+
# Report and write to summary.
169+
python -Im coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
170+
171+
# Report again and fail if under 84%.
172+
python -Im coverage report --fail-under=84
173+
174+
- name: Upload HTML report
175+
uses: actions/upload-artifact@v3
176+
with:
177+
name: html-coverage-report
178+
path: htmlcov
179+
- uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af
180+
with:
181+
name: coverage-reports

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,4 @@ source =
186186
./
187187
/app/
188188
C:\Users\jenkins\workspace\*\src\github.com\elastic\apm-agent-python
189+
D:\a\apm-agent-python\apm-agent-python

0 commit comments

Comments
 (0)