Skip to content

workflow

workflow #188

Workflow file for this run

name: workflow
on:
push:
schedule:
- cron: '0 0 * * 1' # run every Monday
workflow_dispatch:
env:
PYTEST_ADDOPTS: "--color=yes"
jobs:
workflow:
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
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: conda-environment
environment-file: .github/environment.yml
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
# 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