Skip to content

[pre-commit.ci] pre-commit autoupdate #339

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #339

Workflow file for this run

name: Build tutorials (pull requests)
on:
pull_request:
branches:
- main
types:
# We also want this workflow triggered if the 'Run all tutorials' label
# is added or present when PR is updated
- opened
- reopened
- synchronize
- labeled
jobs:
notebooks:
name: "Execute and convert the notebooks to HTML"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.12
- name: Install dependencies
run: |
sudo apt-get install pandoc
python -m pip install -U pip
python -m pip install -r requirements-dev.txt
# Run all tutorials if the label is present
- name: Run all tutorials
if: contains(github.event.pull_request.labels.*.name, 'Run all tutorials')
run: |
export TUTORIALS_MAIN_BRANCH=origin/main
make clean
make buildall
shell: bash
# Otherwise, only run tutorials that have been modified
- name: Run only modified tutorials
if: "!contains(github.event.pull_request.labels.*.name, 'Run all tutorials')"
run: |
export TUTORIALS_MAIN_BRANCH=origin/main
make build
shell: bash
- name: Name artifact
id: nameartifact
run: |
echo "::set-output name=artifactName::rendered-tutorials"
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ${{ steps.nameartifact.outputs.artifactName }}
path: _build