Add automated notebook testing with Papermill #8
This file contains hidden or 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: Test Notebooks | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "pyproject.toml" | |
| - "causalpy/**" | |
| - ".github/workflows/test_notebook.yml" | |
| - "scripts/run_notebooks/**" | |
| - "docs/source/notebooks/**" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "pyproject.toml" | |
| - "causalpy/**" | |
| - ".github/workflows/test_notebook.yml" | |
| - "scripts/run_notebooks/**" | |
| - "docs/source/notebooks/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| notebooks: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| strategy: | |
| matrix: | |
| split: | |
| - "--pattern *_pymc*.ipynb" | |
| - "--pattern *_skl*.ipynb" | |
| - "--exclude-pattern _pymc --exclude-pattern _skl" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -e ".[test,docs]" | |
| - name: Run notebooks | |
| run: python scripts/run_notebooks/runner.py ${{ matrix.split }} |