Optimize CI: conditional jobs, test rebalancing, macOS platform-aware gating#4853
Merged
Optimize CI: conditional jobs, test rebalancing, macOS platform-aware gating#4853
Conversation
Use dorny/paths-filter to detect which components changed in PRs and skip irrelevant test jobs. Build-only jobs always run. Push to master always runs everything. Co-Authored-By: Claude Code
Compute pre-combined dependency groups (pjlib-deps, pjnath-deps, pjmedia-deps, pjsip-deps, pjnath-pjmedia-deps, pjnath-pjsip-deps, any-src) in detect-changes job so each test job's if-condition is a single readable line instead of 5-9 OR'd output checks. Co-Authored-By: Claude Code
Move pjmedia-test from bundle-1 (pjsua) to bundle-3 (pjsip) across Linux and Mac CI workflows for better time balancing. On Mac, also move pjlib-test back to bundle-2 to avoid overloading bundle-3. Add pjmedia-pjsip-deps aggregate output for the new combined bundles. Configure --enable-libwebrtc-aec3 for Linux default bundle-3 and add -DHAS_VID_CODEC_TEST=0 for video-enabled bundle-3 jobs. Co-Authored-By: Claude Code
PJ_IOQUEUE_CALLBACK_NO_LOCK is now 1 by default, so the CI special config job should test the opposite (with-lock, i.e. value 0). Rename jobs from cb-no-lock to cb-with-lock accordingly. Co-Authored-By: Claude Code
Reduces Mac runner slot usage by running both build types sequentially in one job instead of using a matrix strategy. Co-Authored-By: Claude Code
macOS-specific code resides in pjlib (OS abstractions, ioqueue/kqueue, sockets, threading, SSL) and pjmedia (audio/video devices, native codecs, AEC). Other components (pjlib-util, pjnath, pjsip, pjsip-apps) are platform-independent and already covered by Linux CI. Replace per-component conditions with a single mac-full-tests gate that triggers on pjlib, pjmedia, tests, or CI config changes. For other changes (e.g. pjsip-only or pjnath-only PRs), only build-only and CMake jobs run on macOS. Co-Authored-By: Claude Code
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes PJPROJECT CI by adding path-based change detection and conditional job execution across Linux, macOS, and Windows to reduce unnecessary work (especially on scarce macOS runners) and rebalance test bundles for better overall wall-clock time.
Changes:
- Add a
detect-changesjob (usingdorny/paths-filter@v3) and gate test jobs based on aggregated “dependency group” outputs. - Rebalance several test bundles by moving
pjmedia-testfrom some pjsua bundles into pjsip bundles. - Adjust IOQueue callback-lock coverage in CI by flipping the tested default (CI now explicitly tests the “with-lock” configuration).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/ci-linux.yml | Adds change detection + conditional job gating; rebalances Linux test bundles (moves pjmedia-test); updates IOQueue callback-lock job naming/config. |
| .github/workflows/ci-mac.yml | Adds macOS platform-aware gating (full tests only for platform-sensitive changes) and rebalances OpenH264 bundles; merges CMake Debug+Release into one job. |
| .github/workflows/ci-win.yml | Adds change detection + conditional job gating; renames/updates IOCP callback-lock CI job to test with-lock configuration. |
You can also share your feedback on Copilot code review. Take the survey.
Avoid potential ambiguity with hyphens in GitHub Actions expression output names by using underscores (e.g. pjlib_deps, any_src, mac_full_tests, pjlib_util, pjsip_apps). Actual file paths and job IDs are unchanged. Co-Authored-By: Claude Code
sauwming
approved these changes
Mar 13, 2026
Member
sauwming
left a comment
There was a problem hiding this comment.
Great idea! The CI tests have been painfully slow recently.
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.
Background
PJPROJECT CI currently runs the full test suite on all three platforms (Linux, macOS, Windows) for every PR, regardless of which components changed. This leads to several pain points:
This PR addresses these issues by making CI jobs conditional on changed paths, rebalancing test bundles for better parallelism, and applying platform-aware gating to reduce macOS runner pressure.
Feedback, suggestions, and ideas for further CI improvements are very welcome!
Summary
detect-changesjob usingdorny/paths-filter@v3to all 3 CI workflows (Linux, macOS, Windows)github.event_name == 'push'check)macOS conditional test strategy
macOS-specific code resides in pjlib (OS abstractions, ioqueue/kqueue, sockets, threading, SSL) and pjmedia (audio/video devices, native codecs, AEC). Other components are platform-independent protocol logic covered by Linux CI.
Linux/Windows job conditions by component dependency
Test job rebalancing — Linux OpenH264+VPX
Note: Linux bundle-3 gets heavier but gains the correct
pjmedia-pjsip-depscondition, so it skips on pjsua-only or pjnath-only PRs.Test job rebalancing — Linux Default
Test job rebalancing — macOS OpenH264+VPX
Max job time: 32.0m → 29.9m (better balanced: 24/30/27m)
Windows CI test times (no rebalancing needed)
Windows pjmedia is already separate from pjsua — no changes needed.
Expected savings
Test plan
detect-changesjob runs and produces correct outputs on a PRCo-Authored-By: Claude Code