Skip to content

Commit 3faaa6b

Browse files
basic workflow test
1 parent fb251ac commit 3faaa6b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/workflows/notebook-check.yml

Whitespace-only changes.

tools/run_notebooks.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# run_notebooks.py
2+
3+
import os
4+
import nbformat
5+
from nbconvert.preprocessors import ExecutePreprocessor
6+
7+
8+
def run_all_notebooks(path='.'):
9+
print(f"🔍 Scanning for notebooks in: {os.path.abspath(path)}\n")
10+
11+
for root, _, files in os.walk(path):
12+
for file in files:
13+
if file.endswith(".ipynb") and not file.startswith("."):
14+
notebook_path = os.path.join(root, file)
15+
print(f"▶️ Running: {notebook_path}")
16+
17+
with open(notebook_path, encoding="utf-8") as f:
18+
nb = nbformat.read(f, as_version=4)
19+
20+
ep = ExecutePreprocessor(timeout=600, kernel_name='python3')
21+
22+
try:
23+
ep.preprocess(nb, {'metadata': {'path': root}})
24+
print(f"✅ Success: {notebook_path}\n")
25+
except Exception as e:
26+
print(f"❌ Failed: {notebook_path}\nError: {e}\n")
27+
raise RuntimeError(f"Notebook execution failed: {notebook_path}") from e
28+
29+
30+
if __name__ == "__main__":
31+
run_all_notebooks("/workspaces/azure-ai-content-understanding-python/notebooks")

0 commit comments

Comments
 (0)