Skip to content

test(various): Added tests. #80

test(various): Added tests.

test(various): Added tests. #80

Workflow file for this run

# 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/provision-with-micromamba@main
with:
environment-file: false
channel-priority: flexible
channels: usgs-astrogeology, conda-forge
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install ISIS
run: |
micromamba create --name isis
micromamba activate isis
micromamba install -y isis=7.2.0
- 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: Set up kalasiris testing env
run: |
micromamba create --name kal
micromamba activate kal
python -m pip install -e .
- name: Test with pytest and generate coverage report
run: |
micromamba activate kal
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@v3
with:
fail_ci_if_error: true