Skip to content

Commit

Permalink
Add coverage to pytwin (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxime Rey <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2023
1 parent d4ba765 commit f3aa544
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ jobs:
env:
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

- name: Upload coverage artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.python-version }}_${{ matrix.os }}_pytest.html
path: .cov/html
retention-days: 7

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3

check-licenses:
name: "Check library dependencies ship with valid licenses"
runs-on: ubuntu-latest
Expand Down
21 changes: 21 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
comment:
layout: "diff"
behavior: default
require_changes: true # Avoid coverage comment if no files are changed.

coverage:
status:
project:
default:
target: 80%
patch:
default:
# basic
target: auto
threshold: 10%
if_not_found: success
if_ci_failed: error
if_no_uploads: error
ignore:
- "examples" # ignore folder and all its contents
- "doc" # ignore folder and all its contents
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ default_section = "THIRDPARTY"
src_paths = ["doc", "src", "tests"]

[tool.coverage.run]
source = ["pytwin"]
source = ["ansys.pytwin"]

[tool.coverage.report]
show_missing = true

[tool.pytest.ini_options]
minversion = "7.1"
addopts = "-ra --cov=ansys.pytwin --cov-report html:.cov/html"
testpaths = [
"tests",
]

0 comments on commit f3aa544

Please sign in to comment.