Skip to content

Commit

Permalink
add configure coverage using codecov
Browse files Browse the repository at this point in the history
- add step to install package
- save report as xml file in the workflow runner
- add gha to post coverage report
  • Loading branch information
kaitj committed Jun 7, 2023
1 parent 15ae81f commit 2e40e20
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ jobs:
}}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --with dev
run: poetry install --no-interaction --no-root --with dev
- name: Install library
run: poetry install --no-interaction --with dev
- name: Perform unit testing
run: poetry run poe test
run: poetry run poe test_cov
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: ../cov.xml
97 changes: 96 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ poethepoet = "^0.20.0"
yamlfix = "^1.10.0"
pytest = "^7.3.1"
hypothesis = "^6.76.0"
pytest-cov = "^4.1.0"

[build-system]
requires = ["poetry-core"]
Expand All @@ -38,7 +39,11 @@ ruff = "ruff --fix afids_utils"
ruff-check = "ruff afids_utils"
quality = ["yamlfix", "isort", "black", "ruff"]
quality-check = ["yamlfix-check", "isort-check", "black-check", "ruff-check"]
test = "pytest --doctest-modules"
test = "pytest --doctest-modules afids_utils/tests"
test_cov = "pytest --doctest-modules --cov=afids_utils afids_utils/tests/ --cov-report xml:../cov.xml"

[tool.coverage]
omit = "afids_utils/tests/*"

[tool.isort]
profile = "black"
Expand Down

0 comments on commit 2e40e20

Please sign in to comment.