File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed
Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 1- name : Comment on PR
1+ name : Report test coverage on PR
22
33on :
44 pull_request :
55 branches : [ "main" ]
66
77jobs :
8- comment :
8+ comment-test-coverage :
99 runs-on : ubuntu-latest
1010 steps :
11+ - name : Checkout
12+ uses : actions/checkout@v4
13+ - name : Install uv
14+ uses : astral-sh/setup-uv@v5
15+ - name : Test
16+ id : test
17+ run : |
18+ echo "coverage<<EOF" >> $GITHUB_OUTPUT
19+ make test-gha >> $GITHUB_OUTPUT
20+ echo "EOF" >> $GITHUB_OUTPUT
21+
1122 - uses : actions/github-script@v7
23+ env :
24+ INPUT_COVERAGE : ${{ steps.test.outputs.coverage }}
1225 with :
13- github-token : ${{secrets.GHA_PRS}}
26+ github-token : ${{ secrets.GHA_PRS }}
1427 script : |
1528 github.rest.issues.createComment({
1629 issue_number: context.issue.number,
1730 owner: context.repo.owner,
1831 repo: context.repo.repo,
19- body: '👋 Thanks for reporting! '
32+ body: '```' + core.getInput('coverage') + '``` '
2033 })
Original file line number Diff line number Diff line change @@ -9,3 +9,7 @@ test-report-mac:
99.PHONY : test-report-win
1010test-report-win :
1111 start htmlcov/index.html
12+
13+ .PHONY : test-gha
14+ test-gha :
15+ uv run pytest --cov-report=term -r f -s
Original file line number Diff line number Diff line change 11def main ():
2- print ("Hello from python-template!" )
2+ print ("Hello from python-basic- template!" )
33
44
55if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments