|
| 1 | +# Runs one notebook. Called by the per-notebook workflows beside this file. |
| 2 | +# |
| 3 | +# One workflow per notebook, rather than one matrix over all of them, because |
| 4 | +# a badge is per workflow: GitHub has no way to show the status of one job in |
| 5 | +# a matrix. A table of notebooks with a badge each is worth nine small files |
| 6 | +# that do nothing but name their notebook and call this. |
| 7 | + |
| 8 | +name: run one notebook |
| 9 | + |
| 10 | +on: |
| 11 | + workflow_call: |
| 12 | + inputs: |
| 13 | + notebook: |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + |
| 20 | +jobs: |
| 21 | + run: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + timeout-minutes: 90 |
| 24 | + steps: |
| 25 | + # See the espnet repository's CI: the default persists GITHUB_TOKEN in |
| 26 | + # .git/config, and nothing here needs it. |
| 27 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 28 | + with: |
| 29 | + persist-credentials: false |
| 30 | + |
| 31 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
| 32 | + with: |
| 33 | + python-version: "3.12" |
| 34 | + |
| 35 | + - name: Install |
| 36 | + run: | |
| 37 | + set -euo pipefail |
| 38 | + python -m pip install --upgrade pip |
| 39 | + # the harness itself, before it can be asked anything |
| 40 | + python -m pip install nbclient nbformat ipykernel \ |
| 41 | + librosa scikit-learn matplotlib tqdm soundfile editdistance |
| 42 | + # then what this notebook's own pip lines ask for. The runner skips |
| 43 | + # those cells, so installing a different espnet from the one a |
| 44 | + # reader gets would make a pass here mean nothing. |
| 45 | + python -m pip install $(python tools/run_notebook.py \ |
| 46 | + "${{ inputs.notebook }}" --print-install) |
| 47 | + # and what it clones and installs - VERSA and ParallelWaveGAN are |
| 48 | + # on nobody's index. --no-build-isolation because ParallelWaveGAN's |
| 49 | + # setup.py imports pip, which an isolated build does not have. |
| 50 | + from_git=$(python tools/run_notebook.py \ |
| 51 | + "${{ inputs.notebook }}" --print-git-install) |
| 52 | + if [ -n "$from_git" ]; then |
| 53 | + python -m pip install --no-build-isolation $from_git |
| 54 | + fi |
| 55 | +
|
| 56 | + - name: Run ${{ inputs.notebook }} |
| 57 | + run: python tools/run_notebook.py "${{ inputs.notebook }}" --timeout 4800 |
0 commit comments