GitHub action unittest #47
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
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
tests: | |
runs-on: self-hosted | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
channels: conda-forge,defaults,mantid | |
auto-update-conda: true | |
miniforge-version: latest | |
python-version: "3.8" | |
environment-file: environment.yml | |
activate-environment: liquid-ref | |
- name: Restore cached conda environment | |
id: cache-load | |
uses: actions/cache/restore@v3 | |
with: | |
path: /usr/share/miniconda/envs/liquid-ref | |
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }} | |
- name: Load Environment | |
if: steps.cache-load.outputs.cache-hit != 'true' | |
run: | | |
mamba env update --file environment.yml --prune | |
- name: Test with pytest | |
run: | | |
git submodule init | |
git submodule update | |
python -m pytest --cov=reduction --cov=scripts --cov-report=xml --cov-report=term | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |