-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.08 KB
/
codecov.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: CodeCov
on:
push:
branches:
- main
pull_request:
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: nhp
use-mamba: true
- name: Cache Conda env
uses: actions/cache@v4
id: cache
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
- name: Update environment
run: mamba env update -n nhp -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Generate Report
run: pytest --cov=. tests/ --ignore=tests --cov-report xml:coverage.xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}