Skip to content

Commit

Permalink
Merge pull request #67 from NTNU-IHB/test-nb
Browse files Browse the repository at this point in the history
Add CI job to test the notebook
  • Loading branch information
fcollonval authored Feb 18, 2020
2 parents c8d52ca + 32d16bc commit 6c9daaf
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,42 @@ jobs:
python -m pytest --pyargs pythonfmu
cd ..
shell: bash -l {0}

test-notebook:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache conda packages for Linux
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v1
with:
path: /usr/share/miniconda/pkgs
key: ${{ runner.os }}-test-nb-cache-conda-pkgs-${{ hashFiles('binder/environment.yml') }}
restore-keys: |
${{ runner.os }}-test-nb-cache-conda-pkgs-
${{ runner.os }}-test-nb-
- name: Setup Python
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true

- name: Run the Tests
run: |
conda activate test
# Install binder dependencies - update binder/environment.yml if they changed
cp binder/* .
conda env update --name=test --file=environment.yml
bash ./postBuild
cd ./examples
jupyter nbconvert --to notebook --execute demo.ipynb
cd ..
shell: bash -l {0}

- name: Archive executed notbook
uses: actions/upload-artifact@v1
with:
name: nb-examples
path: examples

0 comments on commit 6c9daaf

Please sign in to comment.