-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from h-0-0/h-0-0-dev
.
- Loading branch information
Showing
2 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,48 @@ jobs: | |
- name: Test with pytest and create coverage report | ||
run: | | ||
pytest --cov-report term-missing --cov=src tests/ | ||
- name: Comment test coverage | ||
uses: itsparser/[email protected] | ||
env: | ||
path: coverage/lcov.info | ||
title: "Test Coverage" | ||
threshold: 80 | ||
- name: Create coverage and test badge | ||
uses: gaelgirodon/ci-badges-action@v1 | ||
with: | ||
gist-id: 4aa01e058fee448070c587f6967037e4 | ||
token: ${{ secrets.GIST_TOKEN }} | ||
# - name: Comment test coverage | ||
# uses: itsparser/[email protected] | ||
# env: | ||
# path: coverage/lcov.info | ||
# title: "Test Coverage" | ||
# threshold: 80 | ||
# - name: Create coverage and test badge | ||
# uses: gaelgirodon/ci-badges-action@v1 | ||
# with: | ||
# gist-id: 4aa01e058fee448070c587f6967037e4 | ||
# token: ${{ secrets.GIST_TOKEN }} | ||
|
||
name: Update Coverage on Readme | ||
on: | ||
push: | ||
branches: | ||
- test-branch | ||
jobs: | ||
update-coverage-on-readme: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
|
||
- name: Pytest coverage comment | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
id: coverageComment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
hide-comment: true | ||
pytest-coverage-path: ./data/pytest-coverage_4.txt | ||
|
||
- name: Update Readme with Coverage Html | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.summary_report.outputs.content }}\n<!-- Pytest Coverage Comment:End -->' ./README.md | ||
- name: Commit & Push changes to Readme | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: actions-js/push@master | ||
with: | ||
message: Update coverage on Readme | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters