Update .gitea/workflows/notebook-test.yml
Some checks failed
CI Demo / build (push) Successful in 3s
Docker Test / docker-ops (push) Successful in 5s
.NET Test / dotnet-test (push) Successful in 52s
Go Test / go-test (push) Successful in 19s
Java Test / java-hello (push) Successful in 34s
Julia Test / julia-test (push) Successful in 19s
Kotlin Test / kotlin-hello (push) Successful in 37s
Node.js Test / nodejs-test (push) Successful in 15s
Notebook Test / nb-test (push) Successful in 11s
PHP Test / php-test (push) Successful in 36s
Python Test / python-hello (push) Successful in 3s
R Test / r-cmdcheck (push) Failing after 16m48s
Rust Test / rust-test (push) Failing after 29s
Scala Test / scala-test (push) Failing after 1m55s
Swift Test / swift-hello (push) Successful in 45s

This commit is contained in:
2025-08-07 20:58:11 +00:00
parent da29bc2261
commit e55e03542f

View File

@@ -10,7 +10,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.11" # avoid bleeding-edge 3.13 surprises python-version: "3.11"
- name: Install deps - name: Install deps
run: | run: |
@@ -21,18 +21,21 @@ jobs:
run: python -m ipykernel install --user --name python3 run: python -m ipykernel install --user --name python3
- name: Create sample notebook if missing - name: Create sample notebook if missing
shell: bash
run: | run: |
set -euo pipefail
if [ ! -f notebook.ipynb ]; then if [ ! -f notebook.ipynb ]; then
python - <<'PY' printf '%s\n' \
import nbformat as nbf 'import nbformat as nbf' \
nb = nbf.v4.new_notebook() 'nb = nbf.v4.new_notebook()' \
nb.cells = [ 'nb.cells = [' \
nbf.v4.new_markdown_cell("# Demo Notebook"), ' nbf.v4.new_markdown_cell("# Demo Notebook"),' \
nbf.v4.new_code_cell("x = 2 + 2\nprint('Result:', x)") ' nbf.v4.new_code_cell("x = 2 + 2\nprint('\'Result:\'', x)")' \
] ']' \
with open("notebook.ipynb", "w", encoding="utf-8") as f: 'with open("notebook.ipynb", "w", encoding="utf-8") as f:' \
nbf.write(nb, f) ' nbf.write(nb, f)' \
PY > create_nb.py
python create_nb.py
fi fi
- name: Execute notebook with Papermill - name: Execute notebook with Papermill