-
Notifications
You must be signed in to change notification settings - Fork 1.6k
98 lines (93 loc) · 3.38 KB
/
Copy pathlessons.yml
File metadata and controls
98 lines (93 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# What a student meets, checked on Linux -- which is what Colab, Kaggle, Binder and Codespaces
# run. The full gates, which need the worked solutions and rubrics, run in the private source
# before a lesson is released; this repository never holds either.
#
name: lessons
on:
push:
pull_request:
schedule:
- cron: "17 5 * * 1" # weekly: catch upstream drift (a new mujoco, a Colab image change)
jobs:
no-answers:
name: no solution or rubric file is committed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
sparse-checkout: |
lessons
programmes
flagships
- run: |
leaked=$(git ls-files | grep -E '(^|/)(solutions|tests|authoring)/' | grep -v '^tools/lesson_template/' || true)
if [ -n "$leaked" ]; then echo "answers committed to the public repository:"; echo "$leaked"; exit 1; fi
echo "no answers committed"
notebooks:
name: committed notebooks and launchers match their lesson.py
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
sparse-checkout: |
lessons
programmes
flagships
tools
brand
- uses: astral-sh/setup-uv@v6
- run: |
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python jupytext==1.19.5
- run: .venv/bin/python tools/notebooks.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:
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
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:
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