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 [![Documentation Status](https://readthedocs.org/projects/cosmicfishpie/badge/?version=latest)](https://cosmicfishpie.readthedocs.io/en/latest/?badge=latest) - -[![Coverage Status](./coverage-badge.svg?dummy=8484744)](./coverage_reports/index.html) +![Coverage](./coverage.svg)
diff --git a/coverage.svg b/coverage.svg new file mode 100644 index 0000000..d199f25 --- /dev/null +++ b/coverage.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + coverage + coverage + 33% + 33% + + diff --git a/pyproject.toml b/pyproject.toml index 1a18354..5e189a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,9 @@ dev = [ "sphinx-autodoc-typehints==1.23.3", "sphinx_rtd_theme>=1.0", "packaging", - "camb" + "camb", + "colossus", + "symbolic-pofk@git+https://github.com/DeaglanBartlett/symbolic_pofk.git" ] [project.scripts] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..4a4ef94 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,10 @@ +[pytest] +testpaths = + tests +addopts = + --cov=cosmicfishpie + --cov-report=xml + --log-cli-level=ERROR +filterwarnings = + ignore::DeprecationWarning + ignore::PendingDeprecationWarning diff --git a/tests/conftest.py b/tests/conftest.py index 2fe4576..18c107f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,7 +2,7 @@ from cosmicfishpie.fishermatrix import cosmicfish as cff -code_to_use = "camb" +code_to_use = "symbolic" @pytest.fixture(scope="module")