From ebb553e5a561e7506bb16b70e94b4a316824282f Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Mon, 7 Oct 2024 15:01:17 -0700 Subject: [PATCH 1/7] trying to fix coverage --- .github/workflows/testing.yml | 7 +++++-- README.md | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c8df5db0..58651778 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -31,7 +31,7 @@ jobs: pip install 'numpy<2.0' pip install matplotlib #Some imports require matplotlib pip install scipy #To not skip tests - pip install flake8 meson-python ninja pytest + pip install flake8 meson-python ninja pytest coveralls # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Checkout Clawpack @@ -53,4 +53,7 @@ jobs: - name: Test with pytest run: | cd ${CLAW}/pyclaw - pytest --ignore=development + coverage run --source=src -m pytest --ignore=development + coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/README.md b/README.md index 32813780..03ead5d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![Build Status](https://github.com/clawpack/pyclaw/actions/workflows/testing.yml/badge.svg)](https://github.com/clawpack/pyclaw/actions) -[![Coverage Status](https://img.shields.io/coveralls/clawpack/pyclaw.svg)](https://coveralls.io/r/clawpack/pyclaw?branch=master) - +[![Coverage Status](https://coveralls.io/repos/github/clawpack/pyclaw/badge.svg?branch=master)](https://coveralls.io/r/clawpack/pyclaw?branch=master) [![PyPI version](https://badge.fury.io/py/clawpack.svg)](https://badge.fury.io/py/clawpack) From 88a78245815696b0a62f73ed5b6e6d16d6e81744 Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Wed, 16 Oct 2024 16:13:01 -0700 Subject: [PATCH 2/7] put the coveralls call in a different job so it happens whether or not there's a failure in the tests --- .github/workflows/testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 58651778..1c62d24e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -54,6 +54,8 @@ jobs: run: | cd ${CLAW}/pyclaw coverage run --source=src -m pytest --ignore=development - coveralls + + -name: Upload to Coveralls + run: coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} From f67e934e419a0e7846ddab2c68470e1bce4219e4 Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Wed, 16 Oct 2024 16:16:40 -0700 Subject: [PATCH 3/7] invalid yaml. trying again --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1c62d24e..8a83ac69 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -55,7 +55,7 @@ jobs: cd ${CLAW}/pyclaw coverage run --source=src -m pytest --ignore=development - -name: Upload to Coveralls + - name: Upload to Coveralls run: coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} From 0db54a865fffd7c2660c21cb11ed7d5f432b84cf Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Wed, 16 Oct 2024 16:21:09 -0700 Subject: [PATCH 4/7] trying to add always() so we upload to coveralls even when a test fails https://stackoverflow.com/questions/58858429/how-to-run-a-github-actions-step-even-if-the-previous-step-fails-while-still-f --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8a83ac69..989b0ef9 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -56,6 +56,7 @@ jobs: coverage run --source=src -m pytest --ignore=development - name: Upload to Coveralls + if: always() run: coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} From 3a066083d7daada54d8bf67c4055a7ac6984b744 Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Wed, 16 Oct 2024 16:30:22 -0700 Subject: [PATCH 5/7] added github_token, because that's what the error message said to do, but not sure why I have to https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 989b0ef9..81d8807a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -60,3 +60,4 @@ jobs: run: coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2d94f3e266ecec2693afafc8b00c71dbcd580966 Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Wed, 16 Oct 2024 16:57:49 -0700 Subject: [PATCH 6/7] added line to see whether .coverage file is being generated --- .github/workflows/testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 81d8807a..469714b2 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -57,7 +57,9 @@ jobs: - name: Upload to Coveralls if: always() - run: coveralls + run: | + ls -l .coverage + coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 173433e38d85e00ad54cbd7b6ed8c88a5f626fdc Mon Sep 17 00:00:00 2001 From: pavelkomarov Date: Thu, 17 Oct 2024 11:49:42 -0700 Subject: [PATCH 7/7] added a cd down to the directory where the coverage report lives --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f694e025..5f6dfe7e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -58,6 +58,7 @@ jobs: - name: Upload to Coveralls if: always() run: | + cd ${CLAW}/pyclaw ls -l .coverage coveralls env: