Run pytest using local conda installation #148
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: [pull_request] | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
# This is required to activate conda environment in GitHub Actions: | |
# See https://stackoverflow.com/questions/72703363/how-to-activate-conda-environment-in-github-actions | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: '3.9' | |
auto-activate-base: false | |
activate-environment: benchcab-dev | |
environment-file: .conda/benchcab-dev.yaml | |
- name: Test with pytest | |
run: | | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
test_conda_package_install: | |
runs-on: ubuntu-latest | |
# This is required to activate conda environment in GitHub Actions: | |
# See https://stackoverflow.com/questions/72703363/how-to-activate-conda-environment-in-github-actions | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
#with: | |
#fetch-depth: 0 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: '3.9' | |
- name: Build and install conda package | |
run: | | |
conda install conda-build | |
conda build -c conda-forge -c accessnri -c coecms . | |
conda install --no-channel-priority -c $CONDA_PREFIX/conda-bld -c conda-forge -c accessnri -c coecms benchcab | |
conda uninstall conda-build | |
- name: Pytest | |
run: | | |
conda install pytest | |
pytest |