This action automatically runs your Notebooks in VS Code to check for errors, so that you don't have to.
If you register this action on a pull request, it will notify you in case of any errors (i.e. Notebooks with a failed code cell) with the error details:

It also uploads the executed Notebooks themselves (notebooks.zip) as artifacts to the Actions summary:

In some cases, further inspection on what went wrong in a Notebook might be necessary. Here, it can be of great value to unpack the above artifacts and taking a close look at the Notebook by opening it in your local VS Code Editor:

This action is a composite action that requires an image which includes xvfb
.
The only required inputs are a string of notebook-files
to test.
Warning
This action does not check the contents of the input notebooks. It is recommended to only run notebooks from trusted sources.
Name | Description | Required | Default |
---|---|---|---|
notebook-files |
Notebooks to be tested, separated by spaces | ✓ | |
notebook-file-ext |
Notebook file extension | capnb |
|
notebook-vscode-ext |
VS Code Notebook extension to install | SAPSE.vscode-cds |
|
timeout |
Mocha timeout for VS Code tests | 120000 |
|
vscode-version |
VS Code version to use | stable |
|
artifacts-on-success |
Upload artifacts on success | false |
|
artifacts-kind |
Copy folder to be uploaded as artifacts | file |
Below is an example which shows how to use this action to test 2 sample CAP Notebooks, which you can also find in this repository under the _notebooks directory:
container:
# Docker image containing xvfb
image: sitespeedio/sitespeed.io
steps:
- name: Install CAP's cds-dk
run: |
npm i -g @sap/cds-dk
- name: Test CAP Notebooks
uses: mnkiefer/notebook-runner@main
with:
notebook-files: "_notebooks/hello-world_broken.capnb _notebooks/hello-world_node.capnb"