Repository navigation
ci: select Tests jobs per affected component - #147
Merged
Merged
Conversation
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
The Tests workflow's classifier had two answers: docs/press-kit only (skip everything) or full CI. Every other change ran all four heavy jobs, including the 25-minute iPhone Duo UI-test job on a macOS runner. A release-tooling-only change like #146, a one-line Mac test fix like #143 and an Android-only fix like #68 each used about 36 macOS runner-minutes and took about 26 minutes of wall-clock time.
This PR replaces the two booleans with one output per job, chosen from a dependency map I checked against the real build graph (
project.ymltargets, the Android Gradle build and the files the macOS tests read at runtime). It doesn't use directory names alone.Mac/,MacReceiver/,MacTests/mac(without the iOS build step)iOS/mac+ iOS build +ios-duoiOS/DemoSession.swiftand reads iOS sources, catalogs and the privacy manifestiOSUITests/ios-duoShared/(protocol, pairing, encryption)fixtures/mac+androidcore/build.gradle.kts)project.yml,.xcode-versionAndroidReceiver/androidscripts/release,scripts/reference, the 14 listed workflows, rulesets, fastlane config, Gemfile, version filesrelease-toolingtests.ymlcalls none of them; release-tooling checks thempress-kitfor press-kit paths)tests.yml,scripts/ci/**, any unlisted pathrelease-toolingalso runs for every change that isn't docs or media. It takes about 0.5 minutes on Linux and runs the dependency checks below.The macOS tests scan the repository for the upstream App Store listing ID, so any changed file that contains it also gets
mac, wherever it lives (this used to be checked for docs only).Scope and compatibility
.github/workflows/tests.ymlandscripts/ci/only. No app code, no release workflow, no rulesets.mac,release-tooling,androidandconventionalkeep their names. They are never removed by a workflow-level path filter: a job that isn't needed is skipped, and a skipped job reports success. All three Tests jobs still exist on every run.falsefor it.changesjob fails.--github, a missing base classifier, a classifier crash or missingHEAD^1all mean full CI.mainandrelease/**, multi-commit or force pushes todev, and (new) PRs intomainorrelease/*all run full CI. ci: give each dev push its own Tests run #145's per-SHAdevconcurrency is unchanged.tests.ymlcopies: the old CLI still works and still writesdocs_media_only,workflow_onlyandpress_kit. PR branches that haven't mergeddevyet get answers that are safe for their workflow: app changes get full CI.Verification
python3 -m unittest discover -s scripts/ci: 75 tests OK.ruby scripts/release/check-release-workflows.rb: fail-closed OK. Release-tooling Ruby suite: 112 runs, 0 failures. YAML parses.bash -npasses on the extracted step script.docs/*.md,PROTOCOL.mdorAndroidReceiver/, Gradle reading../docs, a new workflow,tests.ymlusing a local action, a fail-open job condition, a dropped output.changesstep script ran against scratch clones. Transition PR on today'sdev: full CI ("predates per-job selection"). Mac-only PR: mac + release-tooling. Single-commit iOS dev push: Apple jobs. Multi-commit dev push, main push, PR intorelease/2.1.0, shallow clone and a crashing classifier: full CI.tests.ymlandscripts/ci, and the base classifier predates--github. Targeted selection only takes effect for PRs opened againstdevafter this merges.Safety and review checklist
Notes for reviewers
Measured job durations (medians over 46 to 54 successful jobs in the last 60 Tests runs):
ios-duo25.6 min (UI tests 22.9, simulator boot 1.9),mac10.2 min (macOS tests 6.3, iOS build 2.3, Mac receiver 0.9),android5.8 min,release-tooling0.5 min,press-kit0.7 min,changes0.1 min. Both macOS jobs run onxcode-27.Replay estimate. I replayed the last 80 merged PRs into
dev(#34 to #146) through dev's current rules and the new ones, priced at the medians above. "mac without the iOS step" is estimated at 7.7 min. These are estimates, not measured runs.Each PR normally runs Tests at least twice (once per push, plus its merge to
dev), so real totals scale up from these figures.Billing. The repository is public. The runs-timing API reports no billable minutes for these runs, so the gain is runner capacity, macOS queueing and wall-clock time rather than a direct charge.
Intentionally unchanged:
mac(generic device, for the SDK gate) and inios-duo(simulator). They target different SDKs and can't share artifacts.devpushes still run full CI.Prototypes/,assets/(other than README images and the press-kit preview),tools/(other than press-kit),generate.shandrun.shstay full CI.