From 1b1a7fd157fe1dabbe6ec341558d822df97434a0 Mon Sep 17 00:00:00 2001 From: Gregory Ashton Date: Thu, 18 Sep 2025 16:44:42 +0100 Subject: [PATCH 1/3] Updating the coverage badge --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 714445f09..2e98b652d 100644 --- a/README.rst +++ b/README.rst @@ -34,8 +34,8 @@ Please refer to the `Acknowledging/citing bilby guide Date: Thu, 18 Sep 2025 20:56:13 +0100 Subject: [PATCH 2/3] Update the workflow --- .github/workflows/unit-tests.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index efaa94c29..787f1528f 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -57,7 +57,23 @@ jobs: # pre-commit run --all-files --verbose --show-diff-on-failure - name: Run unit tests run: | - pytest --cov=bilby --durations 10 + pytest --cov=bilby --cov-report=xml --cov-report=term --durations 10 - name: Run sampler tests run: | pytest test/integration/sampler_run_test.py --durations 10 -v + - name: Generate coverage badge + if: matrix.python.short-version == '312' && github.ref == 'refs/heads/main' + run: | + source $CONDA_PATH/bin/activate python${{ matrix.python.short-version }} + pip install coverage-badge + coverage-badge -o coverage.svg + shell: bash + - name: Commit coverage badge + if: matrix.python.short-version == '312' && github.ref == 'refs/heads/main' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add coverage.svg || exit 0 + git diff --staged --quiet || git commit -m "Update coverage badge" + git push || exit 0 + shell: bash From 73748c62e669fa06aebaf8bc5ba752ca59105df7 Mon Sep 17 00:00:00 2001 From: Gregory Ashton Date: Fri, 19 Sep 2025 11:23:16 +0100 Subject: [PATCH 3/3] Run on all and upload as artifact --- .github/workflows/unit-tests.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 787f1528f..a501708d4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -62,18 +62,15 @@ jobs: run: | pytest test/integration/sampler_run_test.py --durations 10 -v - name: Generate coverage badge - if: matrix.python.short-version == '312' && github.ref == 'refs/heads/main' + if: matrix.python.short-version == '312' #&& github.ref == 'refs/heads/main' run: | source $CONDA_PATH/bin/activate python${{ matrix.python.short-version }} pip install coverage-badge coverage-badge -o coverage.svg shell: bash - - name: Commit coverage badge - if: matrix.python.short-version == '312' && github.ref == 'refs/heads/main' - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add coverage.svg || exit 0 - git diff --staged --quiet || git commit -m "Update coverage badge" - git push || exit 0 - shell: bash + - name: Upload coverage badge as artifact + if: matrix.python.short-version == '312' #&& github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v4 + with: + name: coverage-badge + path: coverage.svg