File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 32
32
[[ -z "$skip_nb" || "$skip_nb" =~ ^# ]] && continue
33
33
IGNORE_LIST+=("$skip_nb")
34
34
done < .github/ignore-notebooks.txt
35
-
35
+
36
36
# 3) Filter out notebooks that match anything in IGNORE_LIST
37
37
FILTERED_NBS=()
38
38
for nb in $NBS; do
@@ -47,16 +47,16 @@ jobs:
47
47
FILTERED_NBS+=("$nb")
48
48
fi
49
49
done
50
-
50
+
51
51
# 4) Stuff into a single-line JSON array
52
52
NB_JSON=$(printf '%s\n' "${FILTERED_NBS[@]}" \
53
53
| jq -R . \
54
54
| jq -s -c .)
55
-
55
+
56
56
if [ -z "$NB_JSON" ] || [ "$NB_JSON" = "[]" ]; then
57
57
NB_JSON="[]"
58
58
fi
59
-
59
+
60
60
echo "All valid notebooks: $NB_JSON"
61
61
62
62
# 5) Check if there's anything in FILTERED_NBS
65
65
else
66
66
echo "has_notebooks=false" >> $GITHUB_OUTPUT
67
67
fi
68
-
68
+
69
69
echo "notebooks=$NB_JSON" >> $GITHUB_OUTPUT
70
70
71
71
# ---------------------------------------------------------
99
99
python -m venv venv
100
100
source venv/bin/activate
101
101
pip install --upgrade pip setuptools wheel
102
- pip install pytest nbval
102
+ pip install --no-cache-dir pytest nbval
103
103
104
104
- name : Test notebook
105
105
env :
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ jobs:
27
27
# 1) Compare this commit/PR to 'main' and list changed notebooks
28
28
git fetch --depth=1 origin main
29
29
CHANGED_NOTEBOOKS=$(git diff --name-only origin/main | grep '\.ipynb$' || true)
30
-
30
+
31
31
# 2) Load notebooks to ignore
32
32
IGNORE_LIST=()
33
33
while IFS= read -r skip_nb || [ -n "$skip_nb" ]; do
34
34
# Skip empty lines or comment lines
35
35
[[ -z "$skip_nb" || "$skip_nb" =~ ^# ]] && continue
36
36
IGNORE_LIST+=("$skip_nb")
37
37
done < .github/ignore-notebooks.txt
38
-
38
+
39
39
# 3) Filter out ignored notebooks
40
40
FILTERED_NBS=()
41
41
for nb in $CHANGED_NOTEBOOKS; do
@@ -52,16 +52,16 @@ jobs:
52
52
FILTERED_NBS+=("$nb")
53
53
fi
54
54
done
55
-
55
+
56
56
# 4) Stuff into a single-line JSON array
57
57
NB_JSON=$(printf '%s\n' "${FILTERED_NBS[@]}" \
58
58
| jq -R . \
59
59
| jq -s -c .)
60
-
60
+
61
61
if [ -z "$NB_JSON" ] || [ "$NB_JSON" = "[]" ]; then
62
62
NB_JSON="[]"
63
63
fi
64
-
64
+
65
65
echo "All valid notebooks: $NB_JSON"
66
66
67
67
# 5) Check if there's anything in FILTERED_NBS
@@ -104,7 +104,7 @@ jobs:
104
104
python -m venv venv
105
105
source venv/bin/activate
106
106
pip install --upgrade pip setuptools wheel
107
- pip install pytest nbval
107
+ pip install --no-cache-dir pytest nbval
108
108
109
109
- name : Test notebook
110
110
env :
You can’t perform that action at this time.
0 commit comments