Skip to content

Add github action for testing notebooks #65

Add github action for testing notebooks

Add github action for testing notebooks #65

Workflow file for this run

name: Run tests
on:
pull_request:
jobs:
run_notebooks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4.1.7
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with:
# since_last_remote_commit: true
with:
files: |
**.ipynb
- name: Start docker and test container
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
chmod +x ./tests/launch-test-environment.sh
./tests/launch-test-environment.sh
shell: bash
- name: Test all changed files
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file"
docker exec jupyter papermill ../$file /dev/null --execution-timeout=1200 --log-level ERROR
done
- name: Stop docker and test container
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
docker compose --profile all-services down -v
shell: bash