build(code-cover.yml): Don't need a second environment for this code #83
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} |