Repository navigation
305 lines (295 loc) · 14.2 KB
/
Copy pathtests.yml
File metadata and controls
305 lines (295 loc) · 14.2 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
name: tests
on:
# main tests each merged commit. scratch/ branches run CI on a branch with no
# pull request; every other branch runs through pull_request.
push:
branches: [main, "scratch/**"]
pull_request:
permissions:
contents: read
# A newer commit on a pull request cancels the run for the older one. Each push
# gets a group of its own: runs that share a group wait one at a time, and a
# newer one cancels any still waiting, so runs on main would skip commits.
concurrency:
group: tests-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: ${{ matrix.python-version }}
enable-cache: true
- run: uv sync --locked --extra dev --extra repl
- run: uv run ruff check autoform_cli servers tests
- run: uv run pytest -q
- run: make check-example
browser:
name: WebKit dependency explorer regressions
runs-on: ubuntu-latest
timeout-minutes: 15
# Playwright's image for the pinned playwright==1.62.0 carries WebKit and its
# system libraries, so the job does not fetch them from an Ubuntu mirror;
# that apt step alone has taken over 8 minutes and timed the job out.
container:
image: mcr.microsoft.com/playwright/python:v1.62.0-noble@sha256:aa81288e738725378becba5b3e06cb0f3a7f012a610e87e8d767a090ea3f740d
# In a container, run steps default to sh; keep bash, as on the host jobs.
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: "3.13"
enable-cache: true
- name: Install locked browser test environment
run: uv sync --frozen --extra dev --extra browser
# The explorer's typesetting runs the real MathJax, served in place of
# the CDN from the same checked tarball as the MathJax job's.
- name: Install pinned MathJax 3.2.2
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz -o mathjax.tgz
echo "1b9c0a1c44df864e915690558e72adb9cc5203360daefd385084ced3b6c64c09 mathjax.tgz" \
| sha256sum --check --strict
mkdir mathjax
tar xzf mathjax.tgz -C mathjax
echo "AUTOFORM_MATHJAX_DIR=$PWD/mathjax/package" >> "$GITHUB_ENV"
- name: Run dependency explorer browser regressions
run: uv run --frozen --extra dev --extra browser pytest -q tests/test_dag_viewer_browser.py
env:
AUTOFORM_REQUIRE_BROWSER_TESTS: "1"
AUTOFORM_REQUIRE_MATHJAX_TESTS: "1"
mathjax:
name: MathJax read-back cards (Node)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: "3.13"
enable-cache: true
- name: Install locked development environment
run: uv sync --frozen --extra dev
# The npm tarball of the release the site loads, checked against the
# sha256 of the one whose sha1 and sha512 npm publishes.
- name: Install pinned MathJax 3.2.2
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz -o mathjax.tgz
echo "1b9c0a1c44df864e915690558e72adb9cc5203360daefd385084ced3b6c64c09 mathjax.tgz" \
| sha256sum --check --strict
mkdir mathjax
tar xzf mathjax.tgz -C mathjax
echo "AUTOFORM_MATHJAX_DIR=$PWD/mathjax/package" >> "$GITHUB_ENV"
- name: Typeset read-back cards in Node with the script render writes
run: uv run --frozen --extra dev pytest -q tests/test_site_mathjax_node.py
env:
AUTOFORM_REQUIRE_MATHJAX_TESTS: "1"
real-lean:
name: real Lean (fixture toolchain)
runs-on: ubuntu-latest
timeout-minutes: 75
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: "3.13"
enable-cache: true
- name: Install locked development environment
run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl
- name: Install pinned Elan
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \
-o elan.tar.gz
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \
| sha256sum --check --strict
tar xzf elan.tar.gz
./elan-init -y --default-toolchain none
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
- name: Install the fixture's Lean toolchain
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=30s 10m \
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/skeleton-project/lean-toolchain)"
command -v lake
- name: Install the library fixture's Lean toolchain
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=30s 10m \
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/library-project/lean-toolchain)"
- name: Build a project from the bundled creation release
run: |
set -euo pipefail
generated_project="$RUNNER_TEMP/autoform-created-project"
uv run autoform project new "$generated_project" \
--package GeneratedProject \
--release lean-v4.32.2-mathlib-v4.32.2
cd "$generated_project"
timeout --signal=TERM --kill-after=30s 20m lake exe cache get
timeout --signal=TERM --kill-after=30s 10m lake build
- name: Audit the created project as its workflow does
run: |
set -euo pipefail
# The template's helper, so the step audits this checkout's probe on a
# build that imports all of Mathlib.
helper="$PWD/autoform_cli/templates/github/autoform_audit.py"
archive="$RUNNER_TEMP/autoform-created-root.tgz"
probe="$RUNNER_TEMP/autoform-created-probe.lean"
output="$RUNNER_TEMP/autoform-created-probe.out"
cd "$RUNNER_TEMP/autoform-created-project"
lake pack "$archive"
python3 "$helper" GeneratedProject "$archive" "$probe"
lean_path="$(lake env printenv LEAN_PATH)"
AUTOFORM_AUDIT_LEAN_PATH="$lean_path" LEAN_ABORT_ON_PANIC=1 \
timeout --signal=TERM --kill-after=30s 15m lean "$probe" | tee "$output"
if ! tail -n 1 "$output" | grep -Eq '^kernel trust clean \('; then
echo "the audit probe did not end with its success line" >&2
exit 1
fi
- name: Run the impact probe against real Lean
run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_impact.py
env:
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
- name: Run the library index generator against real Lean
run: timeout --signal=TERM --kill-after=30s 30m uv run pytest -q tests/test_library_generate.py
env:
AUTOFORM_REQUIRE_REAL_LIBRARY_TESTS: "1"
- name: Run the open-statement audit and contract against real Lean
run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_lake_artifact_audit.py tests/test_contract.py
env:
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
- name: Run the LSP lifecycle and diagnostics checks against real Lean
run: >-
timeout --signal=TERM --kill-after=30s 10m uv run pytest -q -k real_lean
tests/test_lsp_protocol.py tests/test_batch_diagnostics.py
env:
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
AUTOFORM_REAL_LEAN_MATHLIB_PROJECT: ${{ runner.temp }}/autoform-created-project
real-lean-skeleton:
name: real Lean skeleton suite (fixture toolchain)
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: "3.13"
enable-cache: true
- name: Install locked development environment
run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl
- name: Install pinned Elan
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \
-o elan.tar.gz
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \
| sha256sum --check --strict
tar xzf elan.tar.gz
./elan-init -y --default-toolchain none
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
- name: Install the fixture's Lean toolchain
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=30s 10m \
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/skeleton-project/lean-toolchain)"
command -v lake
- name: Run the skeleton suite against real Lean
run: >-
timeout --signal=TERM --kill-after=30s 35m uv run pytest -q
tests/test_skeleton.py
tests/test_project_inspect.py::test_stale_inherited_mathlib_is_ignored_by_real_lake
env:
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
real-repl:
name: real REPL (fixture toolchain)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: "3.13"
enable-cache: true
- name: Install pinned Elan
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \
-o elan.tar.gz
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \
| sha256sum --check --strict
tar xzf elan.tar.gz
./elan-init -y --default-toolchain none
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
- name: Build the REPL fixture
working-directory: tests/fixtures/repl-smoke
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=30s 5m \
elan toolchain install "$(tr -d '\r\n' < lean-toolchain)"
timeout --signal=TERM --kill-after=30s 8m lake build Mathlib Secret @repl/repl
- name: Install the minimum supported Lean toolchain
run: |
set -euo pipefail
timeout --signal=TERM --kill-after=30s 5m \
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/minimum-lean/lean-toolchain)"
- name: Install locked development environment
run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl
- name: Run the REPL suite against the pinned upstream REPL
run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_real_repl.py
env:
AUTOFORM_RUN_REAL_REPL_TESTS: "1"
windows-hardening:
name: Windows inspection, subprocess, and publication hardening
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.1"
python-version: "3.13"
enable-cache: true
- run: uv sync --frozen --extra dev --extra repl
- name: Exercise inspection, bounded subprocesses, and transactional output
run: >-
uv run pytest -q
tests/test_windows_source_boundary.py
tests/test_tree_snapshot_limits.py
tests/test_project_inspect.py
tests/test_scaffold.py::test_scaffold_merges_autoform_rules_into_lake_gitignore
tests/test_scaffold.py::test_windows_cross_interface_gitignore_identity_ignores_ctime_only
tests/test_scaffold.py::test_scaffold_refuses_case_variants_of_managed_paths
tests/test_skeleton.py::test_bounded_command_rejects_excess_output
tests/test_skeleton.py::test_bounded_command_caps_stdout_and_stderr_together
tests/test_skeleton.py::test_bounded_command_rejects_invalid_utf8
tests/test_skeleton.py::test_bounded_command_timeout_kills_descendants
tests/test_skeleton.py::test_bounded_command_rejects_a_successful_parent_with_a_live_descendant
tests/test_skeleton.py::test_bounded_command_interruption_kills_the_process
tests/test_skeleton.py::test_packet_publication_rolls_back_both_trees_on_commit_failure
tests/test_skeleton.py::test_packet_publication_rolls_back_when_interrupted_after_backup_rename
tests/test_skeleton.py::test_packet_publication_restores_old_trees_when_quarantine_cleanup_fails
tests/test_skeleton.py::test_packet_publication_does_not_overwrite_during_backup_restore
tests/test_claims.py::test_git_runs_without_terminal_prompts
tests/test_claims.py::test_git_stops_at_the_deadline_and_names_the_step
tests/test_claims.py::test_git_does_not_start_once_the_deadline_has_passed