Repository navigation
ci: compile, render and package pull requests that change the app - #336
Merged
Merged
Conversation
…oder The examples test listed its examples by hand and missed window-clearance, menu-bar-delay, essentials.json, the sketchybar-app-font module and the system-monitor package. It now finds them itself: every package installs, and every configuration and module loads beside the installed packages, as StableBar --validate loads it. package.schema.json is now compared with the manifest's and setting's coding keys, as stablebar.schema.json is with the configuration decoders. Refs #221
Build release and Docs images ran only on main, so a pull request could break them, merge, and leave main without a beta, which stable needs. They now run on pull requests that change Sources, Resources, Package.swift, Package.resolved, scripts or this workflow. A change to the scripts, resources or workflow also runs Package, which builds the DMG as the beta does, ad-hoc signed, and checks its signature, stamped version and starter configuration. Test parses every script with the shell its first line names. Pull requests restore main's release cache without saving their own, so they don't evict main's caches. Refs #221
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.
Problem
A pull request ran only a debug build, the tests and commitlint. Build release, Docs images, the packaging scripts and several examples were checked only on
main. A pull request could break them, merge, and then fail onmain, where a failed run publishes no beta, and a stable release needs a beta.Fixes #221.
Changes
Pull requests that change the app now run the release jobs. On pull requests, Check revision reads the changed files from the merge commit (
git diff HEAD^ HEAD, depth-2 checkout without credentials) and sets two outputs:appSources/,Resources/,Package.swift,Package.resolved,scripts/(the filesscripts/unchanged-app.shcompares) orci.ymlpackagingResources/,scripts/orci.ymlDocs-only and tests-only pull requests run what they ran before.
main. On a pull request it restoresmain's release cache but saves none of its own (actions/cache/restore+actions/cache/save). The repository's Actions caches total 10.7 GB against the 10 GB limit, with a 250 MB debug cache per pull request. Adding a 128 MB release cache per pull request would pushmain's caches out sooner.docs-imagesartifact shows reviewers the bar, popups and Settings as the pull request draws them.set-version.shandSTABLEBAR_RELEASE_BUILD=1 ./scripts/package.shwithout secrets, so the app is ad-hoc signed. Then it checks the DMG (hdiutil verify), the app's signature (codesign --verify --deep --strict) and the stamped version and build number. Last, it runs the packaged app's--validate Resources/config.json, which loads its bundled themes. Signing and notarization stay in Beta and Release, and no pull request job gets a secret.scripts/*.shandexamples/**/*.shwith the shell its first line names (zsh -n,sh -n). shellcheck doesn't support zsh, which every script inscripts/uses.Tests.
everyExampleLoadsBesideTheExamplePackagesfinds the examples itself, so a new example needs no entry. It installs every package inexamples/packages. It then loads every configuration (examples/*/,examples/*.json) and module (through an include, as the guide shows) withConfigurationLoader, the same callStableBar --validatemakes. The installed packages sit beside each configuration, sopresentationfinds its theme. Newly covered:window-clearance,menu-bar-delay,essentials.json, thesketchybar-app-fontmodule and thesystem-monitorpackage. This check is a test rather than a--validatestep because Test runs on every pull request andswift testruns it locally.packageSchemaListsTheSamePropertiesAsTheManifestDecodercomparespackage.schema.jsonwith the coding keys ofWidgetPackageManifestandWidgetPackageSetting, as the existing test does forstablebar.schema.json.CONTRIBUTING.mdsays when the new jobs run. TheTestandCommit messagesjob names, the Beta and Release jobs and the workflow's name are unchanged.Cost. Check revision adds a shallow checkout of about 3 s. A pull request that changes Swift code adds Build release (about 3.5 min, in parallel with Test) and then Docs images (about 2 min). One that changes scripts, resources or the workflow also adds Package, in parallel with Docs images. These are macOS runners, which were already queueing: on the last
mainpush, Build release waited 10 minutes for one.Testing
Local:
swift test --filterpasses for the two new tests and the two existing schema and examples tests.window-clearance,presentation, the module andpackage.schema.jsonon purpose. Each break failed with the example's name, for examplewindow-clearance: bar.keepWindowsClaer: Unknown property.. Then I restored the files.fi.build.shpassescodesign --verify --deep --strict, and--validate Resources/config.jsonfrom it printsValid configuration: 3 widgets in 3 files.set-version.shon a copy of the plist stamps0.0.0-pr.1and123.CI on this pull request: this PR changes
ci.yml, so every new job ran here (run 40365094013):main's release cache, compiled in 277 s, and skipped the cache save as intended.StableBar.dmgwithcreate-dmg.hdiutil verifyreported the checksumVALID, the signature and the stamped version passed, and the packaged app printedValid configuration: 3 widgets in 3 files.commandOutputHasABoundedSize(5.43 s against a 5 s bound, inCommandTests, which this PR doesn't touch), and the rerun of that job passed.Wall time on this run: Build release took 5.5 min, Docs images followed with 2 min, and Package then waited 5 min for a macOS runner, so the last check finished 12 min after the push. Test alone took 4.5 min.
Not checked:
create-dmglocally, because it drives Finder. That runs only here in CI. The Developer ID path is unchanged and needs the secrets.Merging
Merge commit or rebase merge. The
test:andci:commits release nothing and touch no app files, somainbuilds no beta for them.Claude Opus 5.5 via Claude Code