mbarlow-rmi is running unit tests #15
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: Run Tests and Coverage for OPGEE | ||
run-name: ${{ github.actor }} is running unit tests | ||
on: | ||
push: | ||
branches: ['feat/github-actions'] | ||
jobs: | ||
test-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
env: | ||
HOME: ${{ github.workspace }} | ||
CI: 'true' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache pip dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: | ||
${{ runner.os }}-pip-${{ hashFiles('requirements.txt')}} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Init opgee conda env | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-version: latest | ||
activate-environment: opgee | ||
python-version: 3.9 | ||
- name: Opgee resolved env cache key | ||
id: opgee-env-key | ||
run: | | ||
ENV_HASH=$(conda list --explicit | sha256sum | cut -d ' ' -f 1) | ||
echo "opgee_hash=$ENV_HASH" >> $GITHUB_OUTPUT | ||
- name: Cache Conda env | ||
id: opgee-env-cache | ||
uses: actions/cache@v3 | ||
env: | ||
# increment cache number to invalidate and rebuild the env | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ${{ env.CONDA }}/envs | ||
key: | ||
${{ runner.os }}-conda-${{ runner.arch }}-${{ hashFiles("py3-opgee-gh-actions.yml") }}-${{ env.CACHE_NUMBER }} | ||
Check failure on line 48 in .github/workflows/opgee-test.yml GitHub Actions / Run Tests and Coverage for OPGEEInvalid workflow file
|
||
- name: Update Conda env | ||
run: | | ||
conda env update -n opgee -f py3-opgee-gh-actions.yml | ||
if: steps.opgee-env-cache.outputs.cache-hit != 'true' | ||
- run: | | ||
python -m pip install . | ||
pip install pytest-cov codecov coveralls PyYAML | ||
- name: Run unit tests with coverate | ||
run: coverage run --source=opgee -m pytest | ||
- name: Code coverage report | ||
if: ${{ success() }} | ||
run: | | ||
coveralls | ||
bash <(curl -s https://codecov.io/bash) |