CI with conda #15
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 with conda | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: "0 5 * * TUE" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: | |
- "3.10" | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: # checks out environment 'test' by default | |
miniconda-version: latest | |
python-version: ${{ matrix.python-version }} | |
mamba-version: "*" | |
channels: conda-forge,defaults | |
channel-priority: true | |
auto-activate-base: false | |
- name: Install dependencies | |
run: | | |
conda config --add pinned_packages python=${{ matrix.python-version }} | |
mamba env update --file environment.yaml --name test | |
mamba env update --file environment_dev.yaml --name test | |
pip install --no-cache-dir --no-deps -e . | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
- name: Test with pytest | |
run: | | |
pytest --cov=./ --cov-report=xml | |
- name: Upload code coverage report | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' | |
uses: codecov/codecov-action@v1 |