|
1 | 1 | name: tests |
2 | 2 |
|
3 | 3 | on: |
4 | | - # main tests each merged commit. scratch/ branches run CI on a branch with no |
5 | | - # pull request; every other branch runs through pull_request. |
6 | 4 | push: |
7 | | - branches: [main, "scratch/**"] |
8 | | - pull_request: |
| 5 | + branches: ["scratch/**"] |
9 | 6 |
|
10 | 7 | permissions: |
11 | 8 | contents: read |
12 | 9 |
|
13 | | -# A newer commit on a pull request cancels the run for the older one. Each push |
14 | | -# gets a group of its own: runs that share a group wait one at a time, and a |
15 | | -# newer one cancels any still waiting, so runs on main would skip commits. |
16 | | -concurrency: |
17 | | - group: tests-${{ github.event.pull_request.number || github.run_id }} |
18 | | - cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
19 | | - |
20 | 10 | jobs: |
21 | | - test: |
22 | | - runs-on: ubuntu-latest |
23 | | - timeout-minutes: 30 |
24 | | - strategy: |
25 | | - matrix: |
26 | | - python-version: ["3.10", "3.13"] |
27 | | - steps: |
28 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
29 | | - - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 |
30 | | - with: |
31 | | - node-version: "22.23.2" |
32 | | - - name: Install pinned explorer compiler |
33 | | - run: | |
34 | | - timeout --signal=TERM --kill-after=30s 3m npm ci --ignore-scripts --no-audit --no-fund --prefer-offline \ |
35 | | - --fetch-timeout=30000 --fetch-retries=2 --fetch-retry-mintimeout=2000 --fetch-retry-maxtimeout=10000 |
36 | | - - run: npm run check:explorer |
37 | | - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
38 | | - with: |
39 | | - version: "0.12.1" |
40 | | - python-version: ${{ matrix.python-version }} |
41 | | - enable-cache: true |
42 | | - - run: uv sync --extra dev --extra repl |
43 | | - - run: uv run ruff check autoform_cli servers tests |
44 | | - - run: uv run pytest -q |
45 | | - - run: make check-example |
46 | | - |
47 | | - browser: |
48 | | - name: WebKit integrated book and explorer regressions |
| 11 | + atlas: |
| 12 | + name: ATLAS screenshots |
49 | 13 | runs-on: ubuntu-latest |
50 | | - timeout-minutes: 25 |
| 14 | + timeout-minutes: 45 |
51 | 15 | steps: |
52 | 16 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
53 | 17 | - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
54 | 18 | with: |
55 | 19 | version: "0.12.1" |
56 | 20 | python-version: "3.13" |
57 | 21 | enable-cache: true |
58 | | - - name: Install locked browser test environment |
59 | | - run: uv sync --frozen --extra dev --extra browser |
60 | | - - name: Install WebKit and Linux system dependencies |
61 | | - run: uv run --frozen --extra browser playwright install --with-deps webkit |
62 | | - - name: Run integrated book, explorer and genuine MathJax regressions |
| 22 | + - run: uv sync --frozen --extra dev --extra browser |
| 23 | + - run: uv run --frozen --extra browser playwright install --with-deps webkit |
| 24 | + - name: Clone the ATLAS wiki |
| 25 | + run: | |
| 26 | + git clone --depth 1 --filter=blob:none --sparse --branch wiki/autoform-blueprint https://github.com/Deicyde/atlas-lean.git atlas |
| 27 | + git -C atlas sparse-checkout set --no-cone '/*' '!/v1/' |
| 28 | + git -C atlas log -1 --format='atlas %h %s' |
| 29 | + - name: Render |
| 30 | + run: uv run --frozen python -m autoform_cli render atlas/blueprint --output atlas/site-src --lean-root atlas |
| 31 | + - name: Build |
| 32 | + working-directory: atlas |
63 | 33 | run: >- |
64 | | - uv run --frozen --extra dev --extra browser pytest -q |
65 | | - tests/test_dag_viewer_browser.py tests/test_integrated_explorer_browser.py |
66 | | - tests/test_integrated_workspace_browser.py tests/test_integrated_continuity_browser.py |
67 | | - env: |
68 | | - AUTOFORM_REQUIRE_BROWSER_TESTS: "1" |
69 | | - AUTOFORM_UI_SCREENSHOT_DIR: ${{ runner.temp }}/autoform-ui-evidence |
70 | | - - name: Preserve browser UI screenshots and diagnostics |
| 34 | + uvx --from mkdocs==1.6.1 --with mkdocs-material==9.6.21 |
| 35 | + --with mkdocs-literate-nav==0.6.2 --with pymdown-extensions==10.21.3 |
| 36 | + mkdocs build --strict |
| 37 | + - name: Screenshot |
| 38 | + run: | |
| 39 | + (cd atlas/site && python3 -m http.server 8765 --bind 127.0.0.1 > /dev/null 2>&1 &) |
| 40 | + sleep 2 |
| 41 | + uv run --frozen --extra browser python .scratch/atlas_shots.py |
| 42 | + - uses: actions/upload-artifact@v4 |
71 | 43 | if: always() |
72 | | - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 |
73 | | - with: |
74 | | - name: integrated-ui-evidence-${{ github.run_id }} |
75 | | - path: ${{ runner.temp }}/autoform-ui-evidence |
76 | | - if-no-files-found: warn |
77 | | - retention-days: 7 |
78 | | - |
79 | | - mathjax: |
80 | | - name: MathJax read-back cards (Node) |
81 | | - runs-on: ubuntu-latest |
82 | | - timeout-minutes: 15 |
83 | | - steps: |
84 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
85 | | - - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 |
86 | | - with: |
87 | | - node-version: "22.23.2" |
88 | | - - name: Install locked native DOM test bridge |
89 | | - run: | |
90 | | - timeout --signal=TERM --kill-after=30s 3m npm ci --ignore-scripts --no-audit --no-fund --prefer-offline \ |
91 | | - --fetch-timeout=30000 --fetch-retries=2 --fetch-retry-mintimeout=2000 --fetch-retry-maxtimeout=10000 |
92 | | - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
93 | | - with: |
94 | | - version: "0.12.1" |
95 | | - python-version: "3.13" |
96 | | - enable-cache: true |
97 | | - - name: Install locked development environment |
98 | | - run: uv sync --frozen --extra dev |
99 | | - # The npm tarball of the release the site loads, checked against the |
100 | | - # sha256 of the one whose sha1 and sha512 npm publishes. |
101 | | - - name: Install pinned MathJax 3.2.2 |
102 | | - run: | |
103 | | - set -euo pipefail |
104 | | - timeout --signal=TERM --kill-after=15s 2m curl -sSfL \ |
105 | | - https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz -o mathjax.tgz |
106 | | - echo "1b9c0a1c44df864e915690558e72adb9cc5203360daefd385084ced3b6c64c09 mathjax.tgz" \ |
107 | | - | sha256sum --check --strict |
108 | | - mkdir mathjax |
109 | | - tar xzf mathjax.tgz -C mathjax |
110 | | - echo "AUTOFORM_MATHJAX_DIR=$PWD/mathjax/package" >> "$GITHUB_ENV" |
111 | | - - name: Typeset read-back cards in Node with the script render writes |
112 | | - run: uv run --frozen --extra dev pytest -q tests/test_site_mathjax_node.py |
113 | | - env: |
114 | | - AUTOFORM_REQUIRE_MATHJAX_TESTS: "1" |
115 | | - |
116 | | - real-lean: |
117 | | - name: real Lean (fixture toolchain) |
118 | | - runs-on: ubuntu-latest |
119 | | - timeout-minutes: 75 |
120 | | - steps: |
121 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
122 | | - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
123 | 44 | with: |
124 | | - version: "0.12.1" |
125 | | - python-version: "3.13" |
126 | | - enable-cache: true |
127 | | - - name: Install locked development environment |
128 | | - run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl |
129 | | - - name: Install pinned Elan |
130 | | - run: | |
131 | | - set -euo pipefail |
132 | | - timeout --signal=TERM --kill-after=15s 2m curl -sSfL \ |
133 | | - https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \ |
134 | | - -o elan.tar.gz |
135 | | - echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \ |
136 | | - | sha256sum --check --strict |
137 | | - tar xzf elan.tar.gz |
138 | | - ./elan-init -y --default-toolchain none |
139 | | - echo "$HOME/.elan/bin" >> "$GITHUB_PATH" |
140 | | - - name: Install the fixture's Lean toolchain |
141 | | - run: | |
142 | | - set -euo pipefail |
143 | | - timeout --signal=TERM --kill-after=30s 10m \ |
144 | | - elan toolchain install "$(tr -d '\r\n' < tests/fixtures/skeleton-project/lean-toolchain)" |
145 | | - command -v lake |
146 | | - - name: Install the library fixture's Lean toolchain |
147 | | - run: | |
148 | | - set -euo pipefail |
149 | | - timeout --signal=TERM --kill-after=30s 10m \ |
150 | | - elan toolchain install "$(tr -d '\r\n' < tests/fixtures/library-project/lean-toolchain)" |
151 | | - - name: Build a project from the bundled creation release |
152 | | - run: | |
153 | | - set -euo pipefail |
154 | | - generated_project="$RUNNER_TEMP/autoform-created-project" |
155 | | - uv run autoform project new "$generated_project" \ |
156 | | - --package GeneratedProject \ |
157 | | - --release lean-v4.32.2-mathlib-v4.32.2 |
158 | | - cd "$generated_project" |
159 | | - timeout --signal=TERM --kill-after=30s 20m lake exe cache get |
160 | | - timeout --signal=TERM --kill-after=30s 10m lake build |
161 | | - - name: Audit the created project as its workflow does |
162 | | - run: | |
163 | | - set -euo pipefail |
164 | | - # The template's helper, so the step audits this checkout's probe on a |
165 | | - # build that imports all of Mathlib. |
166 | | - helper="$PWD/autoform_cli/templates/github/autoform_audit.py" |
167 | | - archive="$RUNNER_TEMP/autoform-created-root.tgz" |
168 | | - probe="$RUNNER_TEMP/autoform-created-probe.lean" |
169 | | - output="$RUNNER_TEMP/autoform-created-probe.out" |
170 | | - cd "$RUNNER_TEMP/autoform-created-project" |
171 | | - lake pack "$archive" |
172 | | - python3 "$helper" GeneratedProject "$archive" "$probe" |
173 | | - lean_path="$(lake env printenv LEAN_PATH)" |
174 | | - AUTOFORM_AUDIT_LEAN_PATH="$lean_path" LEAN_ABORT_ON_PANIC=1 \ |
175 | | - timeout --signal=TERM --kill-after=30s 15m lean "$probe" | tee "$output" |
176 | | - if ! tail -n 1 "$output" | grep -Eq '^kernel trust clean \('; then |
177 | | - echo "the audit probe did not end with its success line" >&2 |
178 | | - exit 1 |
179 | | - fi |
180 | | - - name: Run the impact probe against real Lean |
181 | | - run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_impact.py |
182 | | - env: |
183 | | - AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1" |
184 | | - - name: Run the library index generator against real Lean |
185 | | - run: timeout --signal=TERM --kill-after=30s 30m uv run pytest -q tests/test_library_generate.py |
186 | | - env: |
187 | | - AUTOFORM_REQUIRE_REAL_LIBRARY_TESTS: "1" |
188 | | - - name: Run the open-statement audit and contract against real Lean |
189 | | - run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_lake_artifact_audit.py tests/test_contract.py |
190 | | - env: |
191 | | - AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1" |
192 | | - - name: Run the LSP lifecycle and diagnostics checks against real Lean |
193 | | - run: >- |
194 | | - timeout --signal=TERM --kill-after=30s 10m uv run pytest -q -k real_lean |
195 | | - tests/test_lsp_protocol.py tests/test_batch_diagnostics.py |
196 | | - env: |
197 | | - AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1" |
198 | | - AUTOFORM_REAL_LEAN_MATHLIB_PROJECT: ${{ runner.temp }}/autoform-created-project |
199 | | - |
200 | | - real-lean-skeleton: |
201 | | - name: real Lean skeleton suite (fixture toolchain) |
202 | | - runs-on: ubuntu-latest |
203 | | - timeout-minutes: 40 |
204 | | - steps: |
205 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
206 | | - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
207 | | - with: |
208 | | - version: "0.12.1" |
209 | | - python-version: "3.13" |
210 | | - enable-cache: true |
211 | | - - name: Install locked development environment |
212 | | - run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl |
213 | | - - name: Install pinned Elan |
214 | | - run: | |
215 | | - set -euo pipefail |
216 | | - timeout --signal=TERM --kill-after=15s 2m curl -sSfL \ |
217 | | - https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \ |
218 | | - -o elan.tar.gz |
219 | | - echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \ |
220 | | - | sha256sum --check --strict |
221 | | - tar xzf elan.tar.gz |
222 | | - ./elan-init -y --default-toolchain none |
223 | | - echo "$HOME/.elan/bin" >> "$GITHUB_PATH" |
224 | | - - name: Install the fixture's Lean toolchain |
225 | | - run: | |
226 | | - set -euo pipefail |
227 | | - timeout --signal=TERM --kill-after=30s 10m \ |
228 | | - elan toolchain install "$(tr -d '\r\n' < tests/fixtures/skeleton-project/lean-toolchain)" |
229 | | - command -v lake |
230 | | - - name: Run the skeleton suite against real Lean |
231 | | - run: >- |
232 | | - timeout --signal=TERM --kill-after=30s 35m uv run pytest -q |
233 | | - tests/test_skeleton.py |
234 | | - tests/test_project_inspect.py::test_stale_inherited_mathlib_is_ignored_by_real_lake |
235 | | - env: |
236 | | - AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1" |
237 | | - |
238 | | - real-repl: |
239 | | - name: real REPL (fixture toolchain) |
240 | | - runs-on: ubuntu-latest |
241 | | - timeout-minutes: 15 |
242 | | - steps: |
243 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
244 | | - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
245 | | - with: |
246 | | - version: "0.12.1" |
247 | | - python-version: "3.13" |
248 | | - enable-cache: true |
249 | | - - name: Install pinned Elan |
250 | | - run: | |
251 | | - set -euo pipefail |
252 | | - timeout --signal=TERM --kill-after=15s 2m curl -sSfL \ |
253 | | - https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \ |
254 | | - -o elan.tar.gz |
255 | | - echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \ |
256 | | - | sha256sum --check --strict |
257 | | - tar xzf elan.tar.gz |
258 | | - ./elan-init -y --default-toolchain none |
259 | | - echo "$HOME/.elan/bin" >> "$GITHUB_PATH" |
260 | | - - name: Build the REPL fixture |
261 | | - working-directory: tests/fixtures/repl-smoke |
262 | | - run: | |
263 | | - set -euo pipefail |
264 | | - timeout --signal=TERM --kill-after=30s 5m \ |
265 | | - elan toolchain install "$(tr -d '\r\n' < lean-toolchain)" |
266 | | - timeout --signal=TERM --kill-after=30s 8m lake build Mathlib Secret @repl/repl |
267 | | - - name: Install the minimum supported Lean toolchain |
268 | | - run: | |
269 | | - set -euo pipefail |
270 | | - timeout --signal=TERM --kill-after=30s 5m \ |
271 | | - elan toolchain install "$(tr -d '\r\n' < tests/fixtures/minimum-lean/lean-toolchain)" |
272 | | - - name: Install locked development environment |
273 | | - run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl |
274 | | - - name: Run the REPL suite against the pinned upstream REPL |
275 | | - run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_real_repl.py |
276 | | - env: |
277 | | - AUTOFORM_RUN_REAL_REPL_TESTS: "1" |
278 | | - |
279 | | - windows-hardening: |
280 | | - name: Windows inspection, subprocess, and publication hardening |
281 | | - runs-on: windows-latest |
282 | | - timeout-minutes: 15 |
283 | | - steps: |
284 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
285 | | - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
286 | | - with: |
287 | | - version: "0.12.1" |
288 | | - python-version: "3.13" |
289 | | - enable-cache: true |
290 | | - - run: uv sync --frozen --extra dev --extra repl |
291 | | - - name: Exercise inspection, bounded subprocesses, and transactional output |
292 | | - run: >- |
293 | | - uv run pytest -q |
294 | | - tests/test_windows_source_boundary.py |
295 | | - tests/test_tree_snapshot_limits.py |
296 | | - tests/test_project_inspect.py |
297 | | - tests/test_scaffold.py::test_scaffold_merges_autoform_rules_into_lake_gitignore |
298 | | - tests/test_scaffold.py::test_windows_cross_interface_gitignore_identity_ignores_ctime_only |
299 | | - tests/test_scaffold.py::test_scaffold_refuses_case_variants_of_managed_paths |
300 | | - tests/test_skeleton.py::test_bounded_command_rejects_excess_output |
301 | | - tests/test_skeleton.py::test_bounded_command_caps_stdout_and_stderr_together |
302 | | - tests/test_skeleton.py::test_bounded_command_rejects_invalid_utf8 |
303 | | - tests/test_skeleton.py::test_bounded_command_timeout_kills_descendants |
304 | | - tests/test_skeleton.py::test_bounded_command_rejects_a_successful_parent_with_a_live_descendant |
305 | | - tests/test_skeleton.py::test_bounded_command_interruption_kills_the_process |
306 | | - tests/test_skeleton.py::test_packet_publication_rolls_back_both_trees_on_commit_failure |
307 | | - tests/test_skeleton.py::test_packet_publication_rolls_back_when_interrupted_after_backup_rename |
308 | | - tests/test_skeleton.py::test_packet_publication_restores_old_trees_when_quarantine_cleanup_fails |
309 | | - tests/test_skeleton.py::test_packet_publication_does_not_overwrite_during_backup_restore |
310 | | - tests/test_claims.py::test_git_runs_without_terminal_prompts |
311 | | - tests/test_claims.py::test_git_stops_at_the_deadline_and_names_the_step |
312 | | - tests/test_claims.py::test_git_does_not_start_once_the_deadline_has_passed |
| 45 | + name: atlas-shots |
| 46 | + path: screenshots |
0 commit comments