From c72e8c0391c69429ae95519cdcc92b2b18b188d8 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 27 Sep 2023 19:49:17 -0400 Subject: [PATCH] ci: add codecov --- .github/workflows/python-tests.yml | 14 +++++++++++++- README.rst | 4 ++++ codecov.yml | 15 +++++++++++++++ requirements-dev.txt | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a5cfc98..91cca55 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -24,5 +24,17 @@ jobs: python -m pip install -r requirements-dev.txt - name: Test with pytest + id: test + shell: bash run: | - python -m pytest -v + python -m pytest \ + -rxXs \ + --tb=native \ + --verbose \ + --cov=. \ + tests + + - name: Upload coverage + # any except cancelled or skipped + if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') + uses: codecov/codecov-action@v3 diff --git a/README.rst b/README.rst index 6ef283a..023b15a 100644 --- a/README.rst +++ b/README.rst @@ -128,3 +128,7 @@ Stats .. image:: https://img.shields.io/github/stars/lizardbyte/gsms?logo=github&style=for-the-badge :alt: GitHub stars :target: https://github.com/LizardByte/GSMS + +.. image:: https://img.shields.io/codecov/c/gh/LizardByte/GSMS?token=IC678AQFBI&style=for-the-badge&logo=codecov&label=codecov + :alt: Codecov + :target: https://codecov.io/gh/LizardByte/GSMS diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..c9d3a1a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +--- +codecov: + branch: master + +coverage: + status: + project: + default: + target: auto + threshold: 10% + +comment: + layout: "diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes diff --git a/requirements-dev.txt b/requirements-dev.txt index 3e98ba5..bc18aba 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,3 +2,4 @@ flake8==6.1.0 pyinstaller==6.0.0 pytest==7.4.2 +pytest-cov==4.1.0