ci: check notebooks #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check notebooks | |
on: | |
push: | |
branches: | |
- main | |
tags: '*' | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
test: | |
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ['lts', '1'] | |
os: [ubuntu-latest, macos-latest] | |
arch: [x64, arm64] | |
exclude: | |
- os: ubuntu-latest | |
arch: arm64 | |
- os: macos-latest | |
arch: x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Update pip | |
run: python -m pip install -U pip | |
- name: Install Python dependencies | |
run: python -m pip install -U -r requirements.txt | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: ${{ matrix.version }} | |
arch: ${{ matrix.arch }} | |
- uses: julia-actions/cache@v2 | |
- uses: julia-actions/julia-buildpkg@v1 | |
env: | |
PYTHON: python | |
# Install Papermill for executing notebooks | |
- name: Install Papermill | |
run: python -m pip install papermill | |
# Run all Jupyter notebooks using the wildcard, capture errors | |
- name: Run Jupyter Notebooks | |
run: | | |
EXIT_CODE=0 | |
for notebook in $(find notebooks -name "*.ipynb"); do | |
echo "Running notebook: $notebook" | |
papermill "$notebook" /dev/null || EXIT_CODE=$? | |
done | |
exit $EXIT_CODE |