feat: Phase 5 — GitHub Actions for lint + profile re-run#11
Merged
Conversation
…hase 5)
Phase 5 (final) of the autolens_profiling z_feature roadmap. Wires up
two GitHub Actions workflows + threads AUTOLENS_PROFILING_SMOKE=1 into
every profile script so the lint workflow's smoke step short-circuits
cheaply.
What lands in this PR
---------------------
1. ruff.toml — repo-root ruff config (the repo isn't a Python package
so there's no pyproject.toml). Conservative rule selection:
E/F/W/I/UP/B with E501/E402/F401/B008 ignored for scientific code.
2. .github/workflows/lint.yml — Workflow 1, PR + push-to-main gate.
Target wall time <5 min on CPU-only ubuntu-latest. Steps:
- ruff check . + ruff format --check .
- python scripts/build_readme.py --check (dashboard idempotence)
- lychee markdown link-rot across every README.md
- Smoke: one script per section with AUTOLENS_PROFILING_SMOKE=1
(catches import-graph breakage without running the full profile)
3. .github/workflows/profile.yml — Workflow 2, manual + on release.
- workflow_dispatch with optional `sections` input
- release: published trigger
- Runs every script under likelihood/, simulators/, searches/nautilus/
with continue-on-error per section (single regression doesn't block
the dashboard refresh for the other 16)
- Skips simulators/point_source.py in the loop (its default
dataset_name="simple" overwrites Phase 1's tracked likelihood JSONs)
- Runs scripts/build_readme.py to refresh dashboard tables
- Commits diff back to main as github-actions[bot] with [skip ci]
4. .github/workflows/README.md — documents both workflows + design
decisions captured for future maintainers.
5. AUTOLENS_PROFILING_SMOKE=1 short-circuit threaded into 17 scripts:
- likelihood/imaging/{mge,pixelization,delaunay}.py
- likelihood/interferometer/{mge,pixelization,delaunay}.py
- likelihood/point_source/{image_plane,source_plane}.py
- likelihood/datacube/delaunay.py
- simulators/{imaging,interferometer,point_source,cluster,group,multi}.py
- searches/nautilus/{simple,jax}.py
Inserted via AST-driven helper at the first non-import top-level
statement of each script (after the module docstring + initial
imports, before any module-level execution). Verified end-to-end:
AUTOLENS_PROFILING_SMOKE=1 python <script> exits in <1s for all 3
representative scripts smoked locally.
Design decisions resolved
-------------------------
- Runners: CPU-only on github-hosted ubuntu-latest. Self-hosted GPU
runners can be added later as a separate job without restructuring.
- Cadence: workflow_dispatch + release-triggered only. No weekly cron.
- Bot identity: github-actions[bot] with [skip ci] subject line.
- Failure handling: continue-on-error per script with ::warning::
annotation; dashboard cell shows ERR rather than blocking refresh.
- Smoke env var name: AUTOLENS_PROFILING_SMOKE=1 (proposed in the
Phase 5 prompt, kept as-is).
- ruff config location: ruff.toml at repo root rather than
pyproject.toml — this isn't a Python package, ruff supports the
standalone config file natively.
Test plan
---------
- [x] yaml.safe_load PASSES on both lint.yml and profile.yml.
- [x] py_compile PASSES on all 17 SMOKE-instrumented scripts.
- [x] AUTOLENS_PROFILING_SMOKE=1 python likelihood/imaging/mge.py exits
0 in <1s with "[smoke] ... imports + module setup OK; exiting."
- [x] Same for simulators/imaging.py and searches/nautilus/simple.py.
- [x] scripts/build_readme.py --check exits 0 after SMOKE insertions
(dashboard idempotence preserved).
- [ ] First lint workflow run will be the real check — local YAML
parses but actual GitHub Actions semantics validate on the
runner. Any failures from there get follow-up PRs against this
workflow file.
Closes #7.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 5 (final) of the autolens_profiling z_feature roadmap — wires up CI for the new repo and threads
AUTOLENS_PROFILING_SMOKE=1through every profile script so the lint workflow's smoke step is cheap.Closes #7.
What lands in this PR
Two GitHub Actions workflows
.github/workflows/lint.ymlpull_request,push: mainbuild_readme.py --check), lychee link-rot, smoke 3 scripts.github/workflows/profile.ymlworkflow_dispatch(withsectionsfilter),release: publishedresults/, refresh dashboard, commit back asgithub-actions[bot]with[skip ci]Both target
ubuntu-latest(CPU-only). The smoke step short-circuits each profile script viaAUTOLENS_PROFILING_SMOKE=1, so no real artifacts are produced in the lint workflow.ruff.tomlat repo rootThis repo isn't a Python package, so a standalone
ruff.toml(a supported configuration location) is cleaner than fabricating apyproject.toml. Conservative rule selection:E/F/W/I/UP/B;E501/E402/F401/B008ignored for scientific code patterns.AUTOLENS_PROFILING_SMOKE=1short-circuit threaded into 17 scriptsInserted via an AST-driven helper at the first non-import, non-docstring top-level statement of each script:
Coverage: 17 scripts across
likelihood/{imaging,interferometer,point_source,datacube}/*.py,simulators/*.py,searches/nautilus/*.py. Idempotent — re-running the helper detects existing instances.Workflows README
.github/workflows/README.mddocuments both workflows, the manual-trigger procedure, and captures all design decisions inline for future maintainers.Design decisions resolved
ubuntu-latest. Self-hosted GPU runners deferred (additive on this workflow shape — see top-level README "Future enhancements" for the matching dashboard-side column extension).workflow_dispatch+release: published. No weekly cron — releases are the natural cross-version-comparison anchor.github-actions[bot]with[skip ci]subject line. Avoids lint workflow re-trigger on the auto-generated commit.continue-on-error: trueper section. A single regression emits::warning::and leaves the dashboard cell asERRrather than blocking the refresh for the other 16+ scripts.AUTOLENS_PROFILING_SMOKE=1, per the Phase 5 prompt.ruff.tomlat root (nopyproject.tomlbecause this isn't a Python package).simulators/point_source.pyin the profile loop: its defaultdataset_name=\"simple\"overwrites Phase 1's tracked likelihood JSONs. Manual runs with a non-conflictingdataset_nameremain supported.Test plan
yaml.safe_loadPASSES on both.github/workflows/*.yml.py_compilePASSES on all 17 SMOKE-instrumented scripts.AUTOLENS_PROFILING_SMOKE=1 python likelihood/imaging/mge.pyexits 0 in <1s with the expected smoke-OK line.simulators/imaging.pyandsearches/nautilus/simple.py.python scripts/build_readme.py --checkexits 0 after SMOKE insertions — Phase 4 idempotence is preserved.Refs
scripts/build_readme.pywhich both workflows call.continue-on-errorensures their failure surfaces asERRcells rather than blocking the dashboard refresh.🤖 Generated with Claude Code