diff --git a/.github/workflows/code-qa.yml b/.github/workflows/code-qa.yml index 2dd84bc8..8f506870 100644 --- a/.github/workflows/code-qa.yml +++ b/.github/workflows/code-qa.yml @@ -93,7 +93,7 @@ jobs: pypi: name: Publish to PyPI runs-on: ubuntu-latest - needs: [build, test] + needs: [build, test, example-notebooks] if: startsWith(github.ref, 'refs/tags/v') environment: name: pypi @@ -109,9 +109,32 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + example-notebooks: + name: Run and verify the example notebooks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + cache: pip + cache-dependency-path: pyproject.toml + python-version: "3.12" + - name: Upgrade pip + run: python -m pip install -U pip + - name: Install dependencies + run: python -m pip install '.[docs]' + - name: Run example notebooks + run: |- + for file in docs/source/examples/*.ipynb; do + jupyter nbconvert --to notebook --execute "$file" --output "$file" --ExecutePreprocessor.timeout "${NOTEBOOK_TIMEOUT_SEC:-300}" + done + docs: name: Build documentation runs-on: ubuntu-latest + needs: [example-notebooks] permissions: contents: write steps: