Skip to content

Commit 6c9daaf

Browse files
authored
Merge pull request #67 from NTNU-IHB/test-nb
Add CI job to test the notebook
2 parents c8d52ca + 32d16bc commit 6c9daaf

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/main.yml

+39
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,42 @@ jobs:
143143
python -m pytest --pyargs pythonfmu
144144
cd ..
145145
shell: bash -l {0}
146+
147+
test-notebook:
148+
runs-on: ubuntu-latest
149+
150+
steps:
151+
- uses: actions/checkout@v2
152+
153+
- name: Cache conda packages for Linux
154+
if: startsWith(runner.os, 'Linux')
155+
uses: actions/cache@v1
156+
with:
157+
path: /usr/share/miniconda/pkgs
158+
key: ${{ runner.os }}-test-nb-cache-conda-pkgs-${{ hashFiles('binder/environment.yml') }}
159+
restore-keys: |
160+
${{ runner.os }}-test-nb-cache-conda-pkgs-
161+
${{ runner.os }}-test-nb-
162+
163+
- name: Setup Python
164+
uses: goanpeca/setup-miniconda@v1
165+
with:
166+
auto-update-conda: true
167+
168+
- name: Run the Tests
169+
run: |
170+
conda activate test
171+
# Install binder dependencies - update binder/environment.yml if they changed
172+
cp binder/* .
173+
conda env update --name=test --file=environment.yml
174+
bash ./postBuild
175+
cd ./examples
176+
jupyter nbconvert --to notebook --execute demo.ipynb
177+
cd ..
178+
shell: bash -l {0}
179+
180+
- name: Archive executed notbook
181+
uses: actions/upload-artifact@v1
182+
with:
183+
name: nb-examples
184+
path: examples

0 commit comments

Comments
 (0)