Skip to content

Commit 2c643dc

Browse files
author
Antoine
committed
Enhance coverage report handling in On Release workflow by adding complexity hiding, renaming reports, and updating upload steps
1 parent 14f196a commit 2c643dc

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/workflows/OnRelease.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,43 @@ jobs:
6767
if: success() || failure()
6868
uses: irongut/CodeCoverageSummary@v1.3.0
6969
with:
70-
filename: coverage-report/Cobertura.xml
71-
fail_below_min: true
72-
thresholds: "90 100"
73-
format: markdown
74-
output: both
70+
filename: coverage-report/Cobertura.xml
71+
fail_below_min: true
72+
thresholds: "90 100"
73+
format: markdown
74+
output: both
75+
hide_complexity: true
76+
77+
- name: Rename coverage report
78+
if: success() || failure()
79+
run: mv code-coverage-results.md coverage-report/coverage.${{ matrix.python-version }}.md
80+
81+
- name: upload code coverage report
82+
if: success() || failure()
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: code-coverage-report-${{ matrix.python-version }}
86+
path: coverage-report/coverage.${{ matrix.python-version }}.md
7587

88+
89+
update_release:
90+
runs-on: ubuntu-latest
91+
needs: test
92+
93+
steps:
94+
- name: download code coverage reports
95+
uses: actions/download-artifact@v3
96+
with:
97+
name: code-coverage-report-3.10
98+
99+
76100
- name: add coverage to release description
77-
if: success() || failure()
78101
uses: actions/github-script@v6
79102
with:
80103
script: |
81104
const fs = require('fs');
82-
const coverage = fs.readFileSync('code-coverage-results.md', 'utf8');
83-
const releaseBody = `Python ${{ matrix.python-version }}\n${coverage}\n\n${context.payload.release.body}`;
105+
const coverage = fs.readFileSync('coverage-report/coverage.3.10.md', 'utf8');
106+
const releaseBody = `${coverage}\n\n${context.payload.release.body}`;
84107
github.rest.repos.updateRelease({
85108
owner: context.repo.owner,
86109
repo: context.repo.repo,

0 commit comments

Comments
 (0)