Add TestGroups reusable workflow with auto-discovery - #1
Merged
Conversation
Introduces TestGroups.yml: a reusable workflow that auto-discovers subdirectories under test/ and runs each as a parallel job across a configurable Julia version × OS matrix. Includes a stable ci-success gate job for branch protection rules, fast-path support for draft PRs, and coverage restricted to a single OS/version to avoid redundant uploads. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…@v3, codecov@v6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
Is there a way to actively exclude some directories from (GitHub) CI, such as GPU tests? |
Member
Author
|
yes, it is the |
lkdvos
added a commit
that referenced
this pull request
Apr 28, 2026
* Add TestGroups reusable workflow with auto-discovery of test groups Introduces TestGroups.yml: a reusable workflow that auto-discovers subdirectories under test/ and runs each as a parallel job across a configurable Julia version × OS matrix. Includes a stable ci-success gate job for branch protection rules, fast-path support for draft PRs, and coverage restricted to a single OS/version to avoid redundant uploads. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Improve job and step names for cleaner PR checks view Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update actions to latest versions (checkout@v6, setup-julia@v3, cache@v3, codecov@v6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
lkdvos
added a commit
that referenced
this pull request
Apr 28, 2026
* Add TestGroups reusable workflow with auto-discovery of test groups Introduces TestGroups.yml: a reusable workflow that auto-discovers subdirectories under test/ and runs each as a parallel job across a configurable Julia version × OS matrix. Includes a stable ci-success gate job for branch protection rules, fast-path support for draft PRs, and coverage restricted to a single OS/version to avoid redundant uploads. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Improve job and step names for cleaner PR checks view Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update actions to latest versions (checkout@v6, setup-julia@v3, cache@v3, codecov@v6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <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.
What this adds
Running a large Julia test suite as a single job is slow: everything runs sequentially and a failure in one area blocks everything else. The standard fix is to split tests into groups and run them in parallel on separate runners — but this has historically required each package to manually maintain its own CI matrix, updating it every time a new test group is added or removed.
This PR introduces
TestGroups.yml, a shared reusable workflow for all QuantumKitHub packages that handles this automatically. Add a subfolder undertest/, and it gets picked up and run on its own runner — no CI configuration changes needed.What it does
When a package's CI triggers the workflow, three things happen in sequence:
Discover — the workflow checks out the package and scans the
test/directory for subfolders. Each subfolder (except excluded ones likesetup/andgpu/) becomes a test group.Run in parallel — one CI job is launched per combination of (test group × Julia version × operating system). With the defaults, that's
core (min, ubuntu),core (1, ubuntu),core (min, macos), … all running simultaneously. The test suite inside each job receives the group name as an argument, and ParallelTestRunner.jl routes it to the right files.Report a single result — a final
ci-successjob collects the outcome of every parallel job and reports a single, stable check. This is the only check you need to configure in branch protection rules, regardless of how many test groups exist.There is also a fast path for draft PRs: the matrix collapses to a single OS and Julia version, and
--fastis forwarded to the test suite so individual tests can skip expensive work during development.How to adopt this in a package
Step 1 — Organise
test/into subfoldersEach subfolder is independent and runs on its own runner. The
setup/folder is excluded by default.Step 2 — Wire up
runtests.jlwith ParallelTestRunner.jlParallelTestRunner reads the group name passed by the workflow and includes the matching subfolder's
runtests.jl.Step 3 — Add a workflow file to the package
Create
.github/workflows/Tests.yml(or update the existing one):That's it. No matrix to maintain. Adding a new test group means creating a new subfolder — the workflow picks it up automatically.
Step 4 — Set up branch protection (optional but recommended)
In the repository settings under Branch protection rules, add
ci-successas a required status check onmain. This single check name stays stable no matter how many test groups are added, renamed, or removed.Available options
All options have sensible defaults — most packages won't need to set any of them.
exclude["setup", "gpu"]julia-version["min", "1"]osfastfalse--fastflagnthreads2timeout-minutes60coveragetruelocalregistry🤖 Generated with Claude Code