diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c1bb858..bda209de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..45e0be61 --- /dev/null +++ b/codecov.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 6c5dbfeb..4614b971 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", +]