Skip to content

Commit

Permalink
Added test_notebooks action
Browse files Browse the repository at this point in the history
  • Loading branch information
DonBraulio committed Jun 26, 2023
1 parent f47adc0 commit fb0b0d9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test_notebooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test_notebooks

on: [pull_request]

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: "poetry"

- name: Install dependencies
run: poetry install --no-interaction

- name: Execute all notebooks
run: ./tools/test_notebooks.sh
11 changes: 11 additions & 0 deletions tools/test_notebooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Execute all notebook files under examples/tutorials to check that they work
#
# Usage example:
# ./tools/test_notebooks.sh

# Checks that the code in all notebooks run
for path in $(ls examples/tutorials/*.ipynb); do
poetry run jupyter nbconvert --execute $path --to python --stdout
done

0 comments on commit fb0b0d9

Please sign in to comment.