-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (50 loc) · 1.7 KB
/
code-cover.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
# This workflow is purely to determine code coverage.
# Since there were issues with the pinned version of older versions of ISIS
# and we really only need to run coverage once (not N times for every combination
# in a test matrix), there is some duplication with the primary testing workflow.
name: Code Coverage
on: [push]
env:
isis-data: /test-resources/ISISDATA/
jobs:
coverage:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Conda setup
uses: mamba-org/setup-micromamba@v1
with:
environment-name: isis
create-args: >-
isis=8.0.3
condarc: |
channels:
- usgs-astrogeology
- conda-forge
channel-priority: flexible
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup test-resources/
run: |
mkdir $GITHUB_WORKSPACE/test-resources/
- name: Download IMG
run: curl "https://hirise-pds.lpl.arizona.edu/PDS/EDR/PSP/ORB_010500_010599/PSP_010502_2090/PSP_010502_2090_RED5_0.IMG" -o $GITHUB_WORKSPACE/test-resources/PSP_010502_2090_RED5_0.img
- name: Install kalasiris
run: pip install -e .
- name: Test with pytest and generate coverage report
run: |
micromamba install -y pytest
micromamba install -y pytest-cov
export ISISROOT=$MAMBA_ROOT_PREFIX/envs/isis
export ISISDATA=$MAMBA_ROOT_PREFIX/envs/isis
pytest --cov=./kalasiris --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbse: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}