File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Smoke Tests for Notebooks
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+ paths :
7+ - " notebooks/**/*.ipynb"
8+ - " .github/workflows/notebooks.yml"
9+ push :
10+ branches : [ main ]
11+ paths :
12+ - " notebooks/**/*.ipynb"
13+ - " .github/workflows/notebooks.yml"
14+
15+ permissions :
16+ contents : read
17+
18+ env :
19+ TESTING_PIP_DEPENDENCIES : " papermill nbformat ipykernel"
20+
21+ jobs :
22+ smoke_tests :
23+ runs-on : ubuntu-latest
24+ strategy :
25+ matrix :
26+ # Set the notebooks to validate and run
27+ notebooks_to_validate : ["notebooks/**/*.ipynb"]
28+ notebooks_to_run : ["notebooks/use-cases/document-conversion-standard.ipynb"]
29+ steps :
30+ - uses : actions/checkout@v4
31+
32+ - name : Set up Python
33+ uses : actions/setup-python@v5
34+ with :
35+ python-version : " 3.12"
36+ cache : pip
37+
38+ - name : Install Testing Tools
39+ run : |
40+ pip install ${{ env.TESTING_PIP_DEPENDENCIES }}
41+ ipython kernel install --name "python3" --user
42+
43+ - name : Validate Notebooks
44+ run : |
45+ set -ux
46+
47+ for file in ${{ matrix.notebooks_to_validate }}; do
48+ if [ -f "$file" ]; then
49+ echo "Validating notebook '$file'..."
50+ python -c "import nbformat; nb = nbformat.read('$file', nbformat.NO_CONVERT); nbformat.validate(nb)"
51+ fi
52+ done
53+
54+ - name : Run Notebooks
55+ run : papermill ${{ matrix.notebooks_to_run }} ${{ matrix.notebooks_to_run }}.tmp
You can’t perform that action at this time.
0 commit comments