Skip to content

conda

conda #50

Workflow file for this run

name: conda
on:
schedule:
- cron: '0 0 * * 1' # run every Monday
workflow_dispatch:
env:
PYTEST_ADDOPTS: "--color=yes"
jobs:
conda:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash -l {0}
steps:
- name: Initialisation
uses: actions/checkout@v2
with:
ref: latest
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: conda-environment
environment-file: binder/environment.yml
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
- name: Install testing packages
run: python -m pip install --upgrade pip pytest-cov nbval
# The first import (of discretisedfield) on Windows produces a failure in the notebook tests
# (output mismatch) because of some (hidden) message on stderr (some IO error on Windows that
# does not seem to have an actual effect). By importing it once prior to the actual tests
# this can be circumvented.
# It appears to be package-independent (so just a problem with the first import statement).
# As we see the failure from a cell that imports discretisedfield we do the same import here.
- name: Import discretisedfield in python
run: python -c "import discretisedfield"
if: matrix.os == 'windows-latest'
- name: Test notebooks
run: python -m pytest -v --nbval --sanitize-with nbval.cfg demo.ipynb examples/*.ipynb getting-started/*.ipynb