diff --git a/.github/workflows/notebooks.yaml b/.github/workflows/notebooks.yaml new file mode 100644 index 0000000..4bca260 --- /dev/null +++ b/.github/workflows/notebooks.yaml @@ -0,0 +1,26 @@ +name: Notebooks +on: push + +jobs: + run-notebooks: + runs-on: 4-core-ubuntu-gpu-t4 + steps: + - uses: actions/checkout@v2 + - uses: mamba-org/setup-micromamba@v1.8.1 + with: + environment-file: environment.yml + cache-environment: true + + - name: Check GPU availability + shell: bash -l {0} + run: | + python -c "import torch; print('Is CUDA available:', torch.cuda.is_available())" + + - name: Run notebooks + shell: bash -l {0} + run: | + set -e + export PYTHONPATH=${PWD}:$PYTHONPATH + for file in examples/*.ipynb; do + jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 "$file" + done \ No newline at end of file diff --git a/environment.yml b/environment.yml index 6a0dd3e..e423a7c 100644 --- a/environment.yml +++ b/environment.yml @@ -23,3 +23,4 @@ dependencies: - scikit-learn - pydoclint - coverage + - jupyter