-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (58 loc) · 1.66 KB
/
codecov.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
54
55
56
57
58
59
60
61
62
63
name: CodeCov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: '3.12'
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: ‘2’
# Cache Conda environment installattion
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}
# Setting Up Cache pip installations
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Prepare Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: seismic
environment-file: environment.yml
# python-version: 3.8
auto-activate-base: false
use-only-tar-bz2: true
# To keep Conda activated you have to use 'shell: bash -l {0}' line
# To specifiy the shell
- name: INFO using bash shell
shell: bash -l {0}
run: |
conda info
conda list
- name: Generate Report
shell: bash -l {0}
run: |
pip install pytest-cov
pytest tests --cov=./ --cov-report=xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false