Skip to content

ci: split Python and viewer builds into path-scoped workflows#245

Merged
tangym merged 3 commits into
mainfrom
tangym/ci-viewer-build
Jun 17, 2026
Merged

ci: split Python and viewer builds into path-scoped workflows#245
tangym merged 3 commits into
mainfrom
tangym/ci-viewer-build

Conversation

@tangym

@tangym tangym commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Split CI so the Python build and the SvelteKit viewer build run independently, each gated by a path filter. Frontend-only PRs (e.g. Dependabot Svelte bumps like #240) no longer pay for the Python matrix, and Python-only PRs no longer pay for a Node build.

Problem

The viewer (viewer/, Svelte 5 + SvelteKit 2 + Vite 8) had no CI coverage — Dependabot frontend bumps were merged based on manual validation only. Adding the viewer build unconditionally to build.yml would force every Python-only PR to also pay for npm ci + svelte-check + vite build (and vice versa).

Changes

File What changed
.github/workflows/build.yml Added paths: filter on push and pull_request triggers — Python build now runs only on changes under assert_ai/**, tests/**, pyproject.toml, uv.lock, pytest.ini, or the workflow itself. workflow_dispatch left unfiltered.
.github/workflows/build-viewer.yml (new) New workflow: npm cinpm run check (svelte-check) → npm run build (vite). Working directory viewer, Node 20 with npm cache keyed on viewer/package-lock.json. Triggers only on viewer/** or self-edits.

Disjoint path filters → exactly one of the two workflows runs per PR (or workflow_dispatch for manual runs).

Safety

The viewer is fully standalone — verified by:

grep -r 'viewer' assert_ai/ tests/ --include='*.py' -l   ->  0 matches

So excluding viewer-only changes from the Python build cannot skip anything that would catch a Python regression, and the new viewer workflow doesn't need to coordinate with Python.

Testing

  • YAML parsed cleanly via python -c "import yaml; yaml.safe_load(open(...))" for both files.
  • Viewer build steps validated locally on a clean checkout: npm ci (74 pkgs) + npm run check (0 errors, 6 pre-existing a11y warnings unrelated to this PR) + npm run build (5.56s) all succeed.
  • After merge, the Build workflow will not re-run for this PR (no Python paths touched); the new Build (viewer) workflow will not re-run either (no viewer/** paths touched). Both will exercise on the next relevant PR. Manual workflow_dispatch available on Build to confirm.

tangym added 2 commits June 17, 2026 22:23
Add a paths filter to the push and pull_request triggers of build.yml so

the Python sdist/wheel build and cross-platform install smoke tests only

run when Python-relevant files change (assert_ai/, tests/, pyproject.toml,

uv.lock, pytest.ini, or this workflow itself).

The viewer/ frontend is fully standalone — verified by:

  grep -r 'viewer' assert_ai/ tests/ --include='*.py' -l  ->  0 matches

so excluding viewer-only changes from the Python build does not skip

anything that would catch a Python regression. workflow_dispatch is

intentionally left unfiltered so the Python build can still be run

manually against any branch.
Add a dedicated GitHub Actions workflow that installs the viewer/

lockfile, runs svelte-check, and runs vite build whenever something

under viewer/ (or this workflow file itself) changes.

Motivation: PR #240 (Dependabot Svelte bumps) had no CI coverage

for the frontend, so frontend regressions are caught manually. This

adds an automated gate while keeping viewer/ and the Python build

fully decoupled — the two workflows use disjoint paths filters so a

Python-only PR does not pay for a Node build and a viewer-only PR

does not wait on Python jobs.

Locally validated on a clean checkout: npm ci + npm run check (0

errors) + npm run build (5.56s) all succeed against the current

viewer/ tree.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR splits CI into two independent, path-scoped workflows so Python packaging checks and the SvelteKit viewer build run only when their respective areas change. It improves CI efficiency for Python-only and viewer-only pull requests while adding missing CI coverage for the viewer/ build.

Changes:

  • Scoped the existing Python packaging workflow (Build) to run only when Python-relevant paths (and the workflow itself) change.
  • Added a new viewer workflow (Build (viewer)) that runs npm ci, npm run check (svelte-check), and npm run build (vite) gated to viewer/** changes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/build.yml Adds paths: filters on push/pull_request to gate Python packaging jobs to Python-related changes.
.github/workflows/build-viewer.yml New path-scoped workflow to build and type-check the SvelteKit viewer on viewer/** changes.

Comment thread .github/workflows/build.yml
Comment thread .github/workflows/build.yml
pyproject.toml references README.md (readme) and LICENSE (license.file) as packaging inputs. Without these in the paths filter, a PR that only renames/deletes/edits either file would skip the Python build and any resulting `python -m build` / `twine check` failure would slip through until the next Python-code PR.

Pure trigger widening: no jobs or steps changed. Addresses Copilot review feedback on PR #245.
@tangym tangym enabled auto-merge (squash) June 17, 2026 23:06
@tangym tangym merged commit b819ce5 into main Jun 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants