Skip to content

Commit f85b006

Browse files
committed
ODSC-42785. Add coverage report message to PRs
- added pull-requests: write to be able to post in PR generated comment
1 parent 298b6c1 commit f85b006

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

.github/workflows/run-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ concurrency:
1919

2020
permissions:
2121
contents: read
22+
pull-requests: write
2223

2324
# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
2425
env:
@@ -83,17 +84,7 @@ jobs:
8384
pip install -r test-requirements.txt
8485
python -m pytest ${{ matrix.cov-reports }} tests
8586
86-
- name: "Save coverage files"
87-
uses: actions/upload-artifact@v3
88-
if: ${{ matrix.cov-reports }}
89-
with:
90-
name: cov-reports
91-
path: |
92-
htmlcov/
93-
.coverage
94-
coverage.xml
95-
96-
- name: "Add comment with coverage info to PR"
87+
- name: "Calculate coverage"
9788
if: ${{ success() }} && ${{ github.event.issue.pull_request }}
9889
run: |
9990
set -x # print commands that are executed
@@ -110,7 +101,7 @@ jobs:
110101
echo COV_BODY="$COV_BODY_INTRO ![Coverage-$COV%](https://img.shields.io/badge/coverage-$COV%25-$COLOR)" >> $GITHUB_ENV
111102
fi
112103
113-
- name: "Add comment with cov diff to PR"
104+
- name: "Add comment with coverage info to PR"
114105
uses: actions/github-script@v6
115106
if: ${{ success() }} && ${{ github.event.issue.pull_request }}
116107
with:
@@ -121,4 +112,14 @@ jobs:
121112
owner: context.repo.owner,
122113
repo: context.repo.repo,
123114
body: '${{ env.COV_BODY }}'
124-
})
115+
})
116+
117+
- name: "Save coverage files"
118+
uses: actions/upload-artifact@v3
119+
if: ${{ matrix.cov-reports }}
120+
with:
121+
name: cov-reports
122+
path: |
123+
htmlcov/
124+
.coverage
125+
coverage.xml

0 commit comments

Comments
 (0)