Repository navigation
ci: on a PR, build only the packages a push can affect - #25
Merged
Merged
Conversation
On PR #24, a one-file fix ran all three package builds again, though two had already passed. Now a new "changes" job (tools/ci/changed-jobs.sh) decides per package. On a pull request a package is skipped when: - it passed on this PR before, at some commit S (an actual build: a skip never counts, so reuse doesn't chain), and - no file it builds from changed between S and this run's merge commit. What each package builds from: - all three: Cargo.toml/lock, crates/proto, crates/app/assets (the Mac host inlines the page), this workflow and tools/ci. - macos: crates/host, tools/package-macos.sh, tools/macos. - windows: crates/app's src, build.rs and Cargo.toml. - android: crates/app (Kotlin, launcher icons and Dioxus.toml too), crates/host, tools/build-android.sh. Diffing against the merge commit also counts what dev gained since S, so a skip is never wrong; at worst it rebuilds more than needed. If S is gone (a force push) or GitHub's API fails, everything builds. Pushes to dev, tags and manual runs build everything: each release stamps a new version into all three packages. The changes job's summary says, per package, built or reused, and links the run where it passed. Changes only to docs/ or brand/ no longer start a run, as with Markdown. Dry run against PR #24's runs, with a one-file change each: - Kotlin: android only. - App source: windows and android. - The page's CSS or proto: all three. - docs: none. - tools/package-macos.sh: macos only. - A push to dev: all three.
|
❌ The last analysis has failed. |
Owner
Author
Evidence on this PR
The second run's The first run (43096030201) was never scheduled: GitHub left it queued with no jobs. That was the same Actions trouble that hung the |
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.
On PR #24, a one-file fix ran all three package builds again, though Windows and Android had already passed. With this PR, a package that already passed on the PR is built again only when a file it builds from has changed since.
How it decides
A new
changesjob runstools/ci/changed-jobs.sh. On a pull request, a package is skipped only when both hold:Cargo.toml/Cargo.lock,crates/proto,crates/app/assets(the Mac host inlines the page), the workflow,tools/cicrates/host,tools/package-macos.sh,tools/macoscrates/app'ssrc,build.rs,Cargo.tomlcrates/app(Kotlin, launcher icons,Dioxus.toml),crates/host,tools/build-android.shSafety rules:
devgained since S count too, so a skip is never wrong. At worst it rebuilds more than needed.dev, tags and manual runs, because each release stamps a new version into every package.changesjob's summary lists each package as built or reused, and links the run where a reused one passed. Its package can be downloaded there.Changes only to
docs/orbrand/no longer start a run, the same as Markdown.About #24's case: that fix was in
crates/proto, which all three packages compile, so this PR would still rebuild all three for it. The saving is for changes that touch one platform's files.Testing
Dry run of the script against PR #24's real runs, using throwaway one-file commits:
Share.kt)main.rs)tools/package-macos.shcrates/hostcrates/protodevStill to show: on this PR, the first run builds all three. A second push that touches only a Mac file should build only macos.