ci: split Python and viewer builds into path-scoped workflows#245
Merged
Conversation
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.
There was a problem hiding this comment.
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 runsnpm ci,npm run check(svelte-check), andnpm run build(vite) gated toviewer/**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. |
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.
MohammadHaroonAbuomar
approved these changes
Jun 17, 2026
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
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 tobuild.ymlwould force every Python-only PR to also pay fornpm ci+svelte-check+vite build(and vice versa).Changes
.github/workflows/build.ymlpaths:filter onpushandpull_requesttriggers — Python build now runs only on changes underassert_ai/**,tests/**,pyproject.toml,uv.lock,pytest.ini, or the workflow itself.workflow_dispatchleft unfiltered..github/workflows/build-viewer.yml(new)npm ci→npm run check(svelte-check) →npm run build(vite). Working directoryviewer, Node 20 with npm cache keyed onviewer/package-lock.json. Triggers only onviewer/**or self-edits.Disjoint path filters → exactly one of the two workflows runs per PR (or
workflow_dispatchfor manual runs).Safety
The viewer is fully standalone — verified by:
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
python -c "import yaml; yaml.safe_load(open(...))"for both files.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.viewer/**paths touched). Both will exercise on the next relevant PR. Manualworkflow_dispatchavailable onBuildto confirm.