Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Chan committed Feb 9, 2024
1 parent 887695d commit d679a58
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 1.0.2-35-g0dcd88b
_commit: 1.0.2-42-gffbaa71
_src_path: gh:DiamondLightSource/python-copier-template
author_email: tom.cobb@diamond.ac.uk
author_name: Tom Cobb
Expand Down
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 @@ -31,6 +31,8 @@ jobs:
with:
runs-on: ${{ matrix.runs-on }}
python-version: ${{ matrix.python-version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

container:
needs: check
Expand Down
8 changes: 8 additions & 0 deletions docs/developer/how-to/coverage.md
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`

0 comments on commit d679a58

Please sign in to comment.