Update testing workflow and dependencies #17
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: Test and Coverage | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test-and-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Set up Miniconda and create the environment from environment.yml | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: mimic_env | |
environment-file: environment.yml | |
python-version: "3.10" | |
# Install your package in editable mode | |
- name: Install Your Package | |
shell: bash -l {0} | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda activate mimic_env | |
pip install -e . | |
# Run tests with coverage reporting | |
- name: Run tests with coverage | |
shell: bash -l {0} | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda activate mimic_env | |
pytest --cov=mimic --cov-report=xml --cov-report=html | |
# Upload the coverage report as an artifact | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report | |
path: htmlcov |