Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
type: string
description: The runner to run this job on
required: true
secrets:
CODECOV_TOKEN:
required: true

env:
# https://github.com/pytest-dev/pytest/issues/2042
Expand Down Expand Up @@ -40,7 +43,9 @@ jobs:
run: tox -e pytest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
files: cov.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
with:
python-version: dev
runs-on: ubuntu-latest
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

docs:
needs: check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
with:
runs-on: ${{ matrix.runs-on }}
python-version: ${{ matrix.python-version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
{% endraw %}{% if docker %}
container:
needs: check
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# How to check code coverage

Code coverage is reported to the command line and to a `cov.xml` file by the command `tox -e pytest`. The file is uploaded to the Codecov service in CI.

## Adding a Codecov Token

If the repo is not hosted in DiamondLightSource, then you need to visit `https://app.codecov.io/account/gh/<org_name>/org-upload-token` to generate a token for your org, and store it as a secret named `CODECOV_TOKEN` in `https://github.com/organizations/<org_name>/settings/secrets/actions`