-
Notifications
You must be signed in to change notification settings - Fork 18
53 lines (45 loc) · 1.42 KB
/
get_coverage.yml
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
48
49
50
51
52
53
# Calculates new coverage for the base branch and uploads to codecov
name: Coverage
on:
push:
branches:
- master
jobs:
calc_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "get tags"
run: |
git fetch --tags --force # Retrieve annotated tags.
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0' # versions: https://github.com/mamba-org/micromamba-releases
environment-file: environment.yml
init-shell: >-
bash
powershell
cache-environment: true
post-cleanup: 'all'
# Not sure why this is needed but it appears to be the case
- name: fix env
shell: bash -l {0}
run: |
micromamba shell init --shell bash --root-prefix=~/micromamba
eval "$(micromamba shell hook --shell bash)"
micromamba activate dascore
- name: install dascore
shell: bash -l {0}
run: |
python -m pip install -e .[test]
- name: run test suite
shell: bash -l {0}
run: |
pytest -s --cov dascore --cov-report=xml
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests # optional
name: master_tests # optional
token: ${{ secrets.CODECOV_TOKEN }} # required