From 0bdea435c6dbbbabfb77ca7a720173f37f073547 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Tue, 30 Jan 2024 10:19:01 -0700 Subject: [PATCH 1/2] Fix: Add code cov token to build & specify file --- .github/workflows/build-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index cbbc4ac3..ac78fbef 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -59,3 +59,7 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'}} uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + files: ./coverage.xml From 459973908e6e5722569a21bca36c38c2e6d55053 Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Tue, 30 Jan 2024 16:14:11 -0700 Subject: [PATCH 2/2] Fix: create report on each run and upload --- .gitignore | 1 + changelog.md | 1 + noxfile.py | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9a97a347..e021ede8 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ stravalib-2023/ # Ignore Sphinx auto-generated API stubs # docs/reference/api +coverage.xml diff --git a/changelog.md b/changelog.md index 17484875..960ccaa4 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ - Fix: Docs - add contributing section to top bar for easier discovery and a few small syntax fixes in the docs (@lwasser) - Fix: Manifest.in file - remove example dir (@lwasser, #307) +- Fix: Codecov report wasn't generating correctly (@lwasser, #469) ## v1.6 diff --git a/noxfile.py b/noxfile.py index 3b62826a..2a2b7bd3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -16,8 +16,8 @@ def tests(session): session.install("-r", "requirements.txt") session.run( "pytest", - "--cov", - "src/stravalib", + "--cov=src/stravalib", + "--cov-report=xml:coverage.xml", "src/stravalib/tests/unit/", "src/stravalib/tests/integration/", )