Skip to content

Commit

Permalink
Add test coverage reporting (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicsteinbach authored Jun 20, 2023
1 parent 9f356e3 commit 26591de
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,24 @@ jobs:
python -m pip install --upgrade pip poetry tox
- name: "Test with tox"
run: tox -e tests -- -m "not integration"
run: tox -e tests-coverage -- -m "not integration"

- name: "Upload coverage results"
- name: "Upload coverage artifacts"
uses: actions/upload-artifact@v3
if: matrix.python-version == ${{ env.MAIN_PYTHON_VERSION }}
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && matrix.os == 'ubuntu-latest'}}
with:
name: coverage-html
name: coverage-html-unittests
path: .cov/html
retention-days: 7

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && matrix.os == 'ubuntu-latest'}}
with:
files: .cov/xml
flags: unittests
fail_ci_if_error: true

build-library:
name: "Build library"
runs-on: ubuntu-latest
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/server_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,30 @@ jobs:
pip install poetry 'tox<4' --disable-pip-version-check
- name: "Test with tox (integration tests only)"
run: tox -e tests -- -m "integration"
run: tox -e tests-coverage -- -m "integration"
env:
TEST_SL_URL: ${{secrets.TEST_SERVER_URL}}
TEST_LIST_ADMIN_USER: ${{secrets.TEST_SERVER_ADMIN_USER}}
TEST_LIST_ADMIN_PASS: ${{secrets.TEST_SERVER_ADMIN_PASS}}
TEST_LIST_USER: ${{secrets.TEST_SERVER_USER}}
TEST_LIST_PASS: ${{secrets.TEST_SERVER_PASS}}

- name: "Upload coverage artifacts"
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: coverage-html-integrationtests
path: .cov/html
retention-days: 7

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
files: .cov/xml
flags: integration
fail_ci_if_error: true

doc-build:
name: "Build documentation"
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
:target: https://pypi.org/project/ansys-grantami-recordlists
:alt: PyPI

.. |codecov| image:: https://codecov.io/gh/pyansys/grantami-recordlists/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pyansys/grantami-recordlists
.. |codecov| image:: https://codecov.io/gh/ansys/grantami-recordlists/branch/main/graph/badge.svg
:target: https://codecov.io/gh/ansys/grantami-recordlists
:alt: Codecov

.. |GH-CI| image:: https://github.com/pyansys/grantami-recordlists/actions/workflows/ci_cd.yml/badge.svg
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
# Check https://python-poetry.org/docs/pyproject/ for all available sections
name = "ansys-grantami-recordlists"
version = "1.0.0.post0"
version = "1.0.0.post1"
description = "A python wrapper for the Granta MI RecordLists API"
license = "MIT"
authors = ["ANSYS, Inc. <[email protected]>"]
Expand Down

0 comments on commit 26591de

Please sign in to comment.