Skip to content

Commit

Permalink
test examples with skipping external dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienDoerner authored Nov 8, 2023
1 parent b9a7a63 commit 3384c89
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,15 @@ jobs:
runfolder: "/home/runner/notebook_run"
run: |
cd "$runfolder"
export skipping_nb=" # this notebooks are skipped due to external dependencies
mhd_modelsipynb.py
custom-photon-fieldipynb.py"
function no-skip() {
for f in (${skipping_nb// / }); do
if [ "$f" == "$1"]; then
return 1
fi
done
function skip() { # this notebooks have external dependencies and can not be tested
if [ "$1" = "custom-photon-fieldipynb.py" ] || [ "$1" = "MHD_modelsipynb.py" ] || [ "$1" = "density_grid_samplingipynb.py" ]; then
return 1
fi
return 0
}
for file in *.py; do
if [ -f "$file" ] && [ no-skip "$file" == 0]; then
echo "run file $file"
python3 "$file"
fi
done
for file in *.py; do
skip "$file"
if [ $? -eq 0 ]; then
python3 "$file"
fi
done

0 comments on commit 3384c89

Please sign in to comment.