From a31700bb86bc05e3104a2f334e3984507fc0fd92 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 12 Nov 2024 13:46:38 +0100 Subject: [PATCH] Build notebooks as tests --- .ci_support/build_notebooks.sh | 11 +++++++++++ .github/workflows/notebooks.yml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .ci_support/build_notebooks.sh diff --git a/.ci_support/build_notebooks.sh b/.ci_support/build_notebooks.sh new file mode 100644 index 00000000..08c14214 --- /dev/null +++ b/.ci_support/build_notebooks.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# execute notebooks +i=0; +for notebook in $(ls notebooks/*.ipynb); do + papermill ${notebook} ${notebook%.*}-out.${notebook##*.} -k python3 || i=$((i+1)); +done; + +# push error to next level +if [ $i -gt 0 ]; then + exit 1; +fi; \ No newline at end of file diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index f4d28f53..9cfb0934 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -34,4 +34,4 @@ jobs: timeout-minutes: 5 run: > flux start - papermill notebooks/examples.ipynb examples-out.ipynb -k "python3" + .ci_support/build_notebooks.sh