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
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Notebook Test
|
|
on: [push]
|
|
|
|
jobs:
|
|
nb-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install deps
|
|
run: |
|
|
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
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
if [ ! -f notebook.ipynb ]; then
|
|
printf '%s\n' \
|
|
'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)' \
|
|
> create_nb.py
|
|
python create_nb.py
|
|
fi
|
|
|
|
- name: Execute notebook with Papermill
|
|
run: papermill notebook.ipynb output.ipynb -k python3
|