Update .gitea/workflows/notebook-test.yml
Some checks failed
CI Demo / build (push) Successful in 3s
Docker Test / docker-ops (push) Successful in 4s
.NET Test / dotnet-test (push) Failing after 18s
Go Test / go-test (push) Failing after 4s
Java Test / java-hello (push) Successful in 33s
Julia Test / julia-test (push) Failing after 13s
Node.js Test / nodejs-test (push) Has been cancelled
Kotlin Test / kotlin-hello (push) Has been cancelled
Notebook Test / nb-test (push) Has been cancelled
PHP Test / php-test (push) Has been cancelled
Python Test / python-hello (push) Has been cancelled
R Test / r-cmdcheck (push) Has been cancelled
Rust Test / rust-test (push) Has been cancelled
Scala Test / scala-test (push) Has been cancelled
Swift Test / swift-hello (push) Has been cancelled

This commit is contained in:
2025-08-07 19:18:02 +00:00
parent f4c58cab99
commit df9454e640

View File

@@ -8,13 +8,32 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: "3.11" # avoid bleeding-edge 3.13 surprises
- name: Install papermill
run: pip install papermill
- name: Execute notebooks
- name: Install deps
run: |
papermill notebook.ipynb output.ipynb
python -m pip install --upgrade pip
pip install papermill nbformat ipykernel
- name: Ensure kernel
run: python -m ipykernel install --user --name python3
- name: Create sample notebook if missing
run: |
if [ ! -f notebook.ipynb ]; then
python - <<'PY'
import nbformat as nbf
nb = nbf.v4.new_notebook()
nb.cells = [
nbf.v4.new_markdown_cell("# Demo Notebook"),
nbf.v4.new_code_cell("x = 2 + 2\nprint('Result:', x)")
]
with open("notebook.ipynb", "w", encoding="utf-8") as f:
nbf.write(nb, f)
PY
fi
- name: Execute notebook with Papermill
run: papermill notebook.ipynb output.ipynb -k python3