Skip to content

Commit

Permalink
Merge pull request #1 from h-0-0/h-0-0-dev
Browse files Browse the repository at this point in the history
.
  • Loading branch information
h-0-0 authored Nov 23, 2023
2 parents 7ddef84 + be90617 commit 5a1c305
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
56 changes: 45 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
![version](https://img.shields.io/github/package-json/v/h-0-0/ci-badges-action?style=flat-square)
![license](https://img.shields.io/github/license/h-0-0/ci-badges-action?style=flat-square)
![build](https://img.shields.io/github/actions/workflow/status/h-0-0/ci-badges-action/main.yml?branch=main&style=flat-square)
![tests](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fh-0-0%2F4aa01e058fee448070c587f6967037e4%2Fraw%2Fslune-python-tests.json
)
![coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fh-0-0%2F4aa01e058fee448070c587f6967037e4%2Fraw%2Fslune-python-coverage.json
)
<!-- Pytest Coverage Comment:Begin -->
<!-- Pytest Coverage Comment:End -->


# slune (= slurm + tune!)
Expand Down

0 comments on commit 5a1c305

Please sign in to comment.