generated from populationgenomics/cpg-python-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.07 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Test
on: push
jobs:
run-unittests:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
defaults:
run:
shell: bash -eo pipefail -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup build env
run: |
pip install coverage
- name: "Run unit tests"
id: runtests
run: |
coverage run -m unittest discover
rc=$?
coverage xml
echo "rc=$rc" >> $GITHUB_OUTPUT
- name: "Upload coverage report"
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Fail if tests are not passing
if: ${{ steps.runtests.outputs.rc != 0 }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Unit tests failed with rc = ${{ steps.runtests.outputs.rc }}')