diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..8fb14b9 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,11 @@ +[run] +source = cosmicfishpie +omit = + venv/* + +[report] +exclude_lines = + pragma: no cover + def __repr__ + raise NotImplementedError + if __name__ == .__main__.: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ad843f..dba0a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,4 +16,34 @@ jobs: pip install .[dev] - name: Run tests run: | - pytest \ No newline at end of file + pytest + - name: coverage.py badge + uses: tj-actions/coverage-badge-py@v2.0.3 + - name: Verify Changed files + uses: tj-actions/verify-changed-files@v16 + id: verify-changed-files + with: + files: coverage.svg + - name: Commit files + if: steps.verify-changed-files.outputs.files_changed == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add coverage.svg + git commit -m "Updated coverage.svg" + - name: Push changes + if: steps.verify-changed-files.outputs.files_changed == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.github_token }} + branch: ${{ github.ref }} + - name: Re-pull on failure + if: ${{ failure() }} + run: git pull origin ${{ github.ref }} --autostash --rebase -X ours + - name: Re-push on failure + if: ${{ failure() }} + uses: ad-m/github-push-action@master + with: + branch: ${{ github.ref }} + force: true + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b715b4a..9cfea67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,3 +27,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 1.0.8 : Overview documentation and initial tests 1.1.0 : Implemented symbolic as a new boltzmann solver class. Fixes of feedback prints. More docstrings. 1.1.1 : Resolved gcsp bias bug, new test suite. +1.1.2 : Coverage badge diff --git a/README.md b/README.md index c2af1c7..003e869 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # cosmicfishpie [](https://cosmicfishpie.readthedocs.io/en/latest/?badge=latest) - -[](./coverage_reports/index.html) +