From 701b9d4aa4f410e369ab894c19d286a95869be50 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 19 Mar 2024 22:42:09 +1100 Subject: [PATCH 1/3] Create code coverage when running pytest in GHA --- .github/workflows/main.yml | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 403c5a3f4..58a18a18c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,4 +25,4 @@ jobs: python -m pip install -e .[dev] - name: Test with pytest run: | - python -m pytest -v + python -m pytest --cov -v diff --git a/pyproject.toml b/pyproject.toml index 276938f34..398fcb142 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ doc = [ ] dev = [ 'pytest>=7.0.1', + 'pytest-cov>=4.1.0', 'pytest-timeout>=2.1.0', 'build>=0.7.0', 'pre-commit>=2.20.0', From 09b68459aba342c9190dee10958745890d2339ec Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 19 Mar 2024 22:43:45 +1100 Subject: [PATCH 2/3] Upload coverage report to codecov --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58a18a18c..cd762cf11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,3 +26,8 @@ jobs: - name: Test with pytest run: | python -m pytest --cov -v + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: python-rope/rope From 9026d5bbda3f7c569e8662cfa7f3cab9481d493d Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Tue, 19 Mar 2024 22:49:17 +1100 Subject: [PATCH 3/3] Add codecov badge to README.md --- README.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 52d229431..768077e2a 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ rope -- the world's most advanced open source Python refactoring library ========================================================================= -|Build status badge| |Latest version badge| |Download count badge| |ReadTheDocs status badge| +|Build status badge| |Latest version badge| |Download count badge| |ReadTheDocs status badge| |Codecov badge| .. |Build status badge| image:: https://github.com/python-rope/rope/actions/workflows/main.yml/badge.svg :target: https://github.com/python-rope/rope/actions/workflows/main.yml @@ -23,6 +23,10 @@ :target: https://rope.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status +.. |Codecov badge| image:: https://codecov.io/gh/python-rope/rope/graph/badge.svg?token=pU08MBXFIS + :target: https://codecov.io/gh/python-rope/rope + :alt: Codecov + Overview ========