Skip to content

Catch build failures in Makefile #314

Catch build failures in Makefile

Catch build failures in Makefile #314

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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ steps.nameartifact.outputs.artifactName }}
path: _build