Repository navigation
Make the three C lessons compile on Linux, and mask every machine mea… #4
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
| # The gates, on Linux -- which is what Colab, Kaggle, Binder and Codespaces all run. | |
| # The lessons are developed on macOS; this workflow is the only thing that proves they work | |
| # where students actually open them. | |
| # | |
| # The lessons sit at the repository root; the 2017-2025 tutorials in archive/ are not built | |
| # or tested, so a change that touches only archive/ does not trigger this workflow. | |
| name: lessons | |
| on: | |
| push: | |
| paths-ignore: ["archive/**"] | |
| pull_request: | |
| paths-ignore: ["archive/**"] | |
| schedule: | |
| - cron: "17 5 * * 1" # weekly: catch upstream drift (a new mujoco, a Colab image change) | |
| jobs: | |
| gates: | |
| name: lesson gates, notebook sync, student bundles | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: # the lessons only: archive/ is 2.2 GB that no job reads | |
| filter: blob:none | |
| sparse-checkout: | | |
| lessons | |
| programmes | |
| flagships | |
| tools | |
| brand | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: environment (pinned, as measured) | |
| run: | | |
| uv venv --python 3.12 .venv | |
| uv pip install --python .venv/bin/python -r requirements.txt | |
| - name: every machine-checkable gate on every lesson (see tools/verify_all.py) | |
| run: .venv/bin/python tools/verify_all.py | |
| - name: committed notebooks match their lesson.py | |
| run: .venv/bin/python tools/notebooks.py --check | |
| - name: student bundles build with no solution leaks | |
| run: .venv/bin/python tools/build_student_bundle.py | |
| - name: status tables in MODULES.md and README.md match the lessons | |
| run: .venv/bin/python tools/status.py --check | |
| portable: | |
| name: opens anywhere (${{ matrix.env }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { env: py311, python: "3.11" } # Kaggle-like | |
| - { env: py312, python: "3.12" } # Colab-like | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: # the lessons only: archive/ is 2.2 GB that no job reads | |
| filter: blob:none | |
| sparse-checkout: | | |
| lessons | |
| programmes | |
| flagships | |
| tools | |
| brand | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: a deliberately minimal notebook environment -- no mujoco, no tokenizers | |
| run: | | |
| uv venv --seed --python ${{ matrix.python }} ~/.cache/synapsa-commons/portable/${{ matrix.env }} | |
| uv pip install --python ~/.cache/synapsa-commons/portable/${{ matrix.env }}/bin/python \ | |
| numpy matplotlib ipykernel nbclient nbformat | |
| - name: every notebook, alone in an empty directory, in a real kernel | |
| run: python3 tools/verify_portable.py --env ${{ matrix.env }} --reset | |
| reproducible: | |
| # The FINISHED lesson, run in both environments; its printed results must match. Lines that | |
| # vary between two runs in the same environment (timings, speeds) are masked automatically. | |
| name: same results on Python 3.11 + numpy 2.4 and 3.12 + numpy 2.5 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: # the lessons only: archive/ is 2.2 GB that no job reads | |
| filter: blob:none | |
| sparse-checkout: | | |
| lessons | |
| programmes | |
| flagships | |
| tools | |
| brand | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: both minimal environments | |
| run: | | |
| for v in 3.11 3.12; do | |
| e=~/.cache/synapsa-commons/portable/py${v/./} | |
| uv venv --seed --python $v $e | |
| uv pip install --python $e/bin/python numpy matplotlib ipykernel nbclient nbformat | |
| done | |
| - run: python3 tools/verify_portable.py --completed --reset | |
| live-links: | |
| # The badges and the launcher's raw URLs point at the default branch. On a pull request they | |
| # would fetch that branch's files, not the PR's, so the real URLs are tested only there. | |
| name: badges and raw URLs resolve | |
| if: github.ref_name == github.event.repository.default_branch | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: # the lessons only: archive/ is 2.2 GB that no job reads | |
| filter: blob:none | |
| sparse-checkout: | | |
| lessons | |
| programmes | |
| flagships | |
| tools | |
| brand | |
| - uses: astral-sh/setup-uv@v6 | |
| - run: | | |
| uv venv --seed --python 3.12 ~/.cache/synapsa-commons/portable/py312 | |
| uv pip install --python ~/.cache/synapsa-commons/portable/py312/bin/python \ | |
| numpy matplotlib ipykernel nbclient nbformat | |
| - run: python3 tools/verify_portable.py --env py312 --reset --live |