ci: add Homebrew formula install/test/audit job (#442)#445
Open
aviadshiber wants to merge 3 commits into
Open
Conversation
packaging/homebrew/kapsis.rb was only validated by static grep in tests/test-ctl-packaging.sh, so a Ruby syntax error or a broken `install`/`test do` block could ship silently. Add a new homebrew-formula-test.yml workflow (macos-latest) that runs `brew install --build-from-source`, `brew test`, and `brew audit --strict` against the currently committed formula on packaging/homebrew/kapsis.rb changes, and wire it as a post-release sanity check from release.yml once that version's release assets exist. Per-platform binary resources point at already-released GitHub assets, so this validates the current (already released) formula rather than simulating an unreleased version — documented as a scope comment in the workflow. Fixes #442 Co-Authored-By: Claude Sonnet 5 <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.
Summary
packaging/homebrew/kapsis.rbwas only validated via staticgrepintests/test-ctl-packaging.sh— the formula itself never ran throughbrew, so a Ruby syntax error or a brokeninstall/test doblock would ship silently..github/workflows/homebrew-formula-test.yml(macos-latest), triggered on changes topackaging/homebrew/**, that runs:brew install --formula --build-from-source ./packaging/homebrew/kapsis.rbbrew test kapsisbrew audit --strict --formula ./packaging/homebrew/kapsis.rbrelease.ymlas a post-release sanity job (formula-test, needsupdate-packages), so once the version-bumped formula and its release assets are live, the real installability is checked automatically. Sinceupdate-packagespushes the bump as a new commit tomainand the caller's own triggering ref is the pre-bump commit, the reusable workflow accepts arefinput andrelease.ymlpassesref: mainso it validates the commit that was actually just pushed.resourceblocks in the formula point at GitHub Release assets for the version already committed (matching sha256s). Those assets don't exist yet for an unreleased version being developed in a PR, so this job validates the currently committed (i.e. latest already-released) formula as-is — it does not attempt to simulate installing an unreleased version. It still catches the real failure mode from Homebrew formula is never executed in CI — kapsis.rb install/test blocks validated only by static grep #442: a syntax error or broken block in the Ruby formula.Fixes #442
Test plan
python3 -c "import yaml; yaml.safe_load(...)"on both changed workflow YAML files — parses cleanly./tests/run-all-tests.sh --quick— all passing (pre-existing suite, unaffected by this CI-only change)shellchecknot applicablebrew) will be observed once this PR is open, sincepaths: packaging/homebrew/kapsis.rbwon't fire for this PR (it only touches workflow files) — confirm the workflow itself is at least syntactically valid to GitHub viaworkflow_dispatchor a follow-up formula touch if needed🤖 Generated with Claude Code