Skip to content

ci: set up Homebrew with a script instead of an action - #1288

Merged
Gajesh2007 merged 1 commit into
masterfrom
ci/homebrew-without-action
Oct 1, 2026
Merged

Gajesh2007 merged 1 commit into
masterfrom
ci/homebrew-without-action

Conversation

@davidtai

@davidtai davidtai commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Integration Tests and E2E Benchmarks workflows do not start. Since #1268 (6af40cc) they use Homebrew/actions/setup-homebrew. Homebrew is not a verified creator, and the action is not on the organization allow list, so GitHub rejects the workflow file. Every run on master and on each PR ends in startup_failure. Examples: runs 36775820140 (Integration Tests) and 36775821321 (E2E Benchmarks). ci.yml does not use the action and still runs.

This PR removes the action. A new script, scripts/setup-macos-homebrew.sh, finds or installs Homebrew. It follows scripts/install-macos-github-cli.sh: set -euo pipefail, required-variable checks, a pinned download, and a SHA-256 check before it runs anything.

Linked issue

None. Follow-up to #1268 and #1266.

What changed

  • scripts/setup-macos-homebrew.sh (new):
    • It uses brew if it is on PATH, at /opt/homebrew/bin/brew or at /usr/local/bin/brew.
    • If there is no brew, it downloads install.sh from Homebrew/install commit f6632bc2e9afc0ba20cdee1f2d28bcd7672b3245 and checks the SHA-256 that the script records. Then it runs the installer with NONINTERACTIVE=1 and HOMEBREW_NO_ANALYTICS=1. The install path runs only on macOS.
    • In both cases it runs brew shellenv. It writes HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY to $GITHUB_ENV, and <prefix>/bin and <prefix>/sbin to $GITHUB_PATH.
  • .github/workflows/integration.yml and .github/workflows/benchmarks.yml: the "Set up Homebrew" step now runs the script. brew install postgresql@16 and all other steps are unchanged. The PR adds no action.
  • scripts/test-setup-macos-homebrew.sh (new): an offline test of the "already installed" path. It puts a fake brew and a failing curl in a temporary directory. It checks the $GITHUB_ENV and $GITHUB_PATH lines, that no download happens, and that a missing GITHUB_ENV fails. The "Release Integrity" job runs it next to test-prod-env-refresh.sh.
  • docs/developer/build.md, docs/developer/test.md: replace the text from ci: initialize Homebrew for Blacksmith macOS E2E jobs #1268 about the action, and list the new test.
  • CHANGELOG.md: one entry under "Unreleased — CI and contributor workflow".

Diagrams

Before

flowchart LR
  classDef bad fill:#fde2e1,stroke:#c0392b,color:#000
  classDef step fill:#e8f0fe,stroke:#3366cc,color:#000
  P["push or PR"]:::step --> W["integration.yml / benchmarks.yml"]:::step
  W --> A["uses: Homebrew/actions/setup-homebrew"]:::bad
  A --> F["Org policy rejects the action<br/>startup_failure, no jobs run"]:::bad
Loading

After

flowchart LR
  classDef good fill:#e3f6e8,stroke:#2e8b57,color:#000
  classDef step fill:#e8f0fe,stroke:#3366cc,color:#000
  P["push or PR"]:::step --> W["integration.yml / benchmarks.yml"]:::step
  W --> S["run: scripts/setup-macos-homebrew.sh"]:::good
  S --> Q{"brew found?"}:::step
  Q -- yes --> E["write brew shellenv to<br/>GITHUB_ENV / GITHUB_PATH"]:::good
  Q -- no --> I["download pinned install.sh<br/>check SHA-256, run it"]:::step --> E
  E --> B["brew install postgresql@16<br/>E2E jobs run"]:::good
Loading

Blue: unchanged steps. Red: the failing path. Green: the new path.

Test plan

  • shellcheck scripts/setup-macos-homebrew.sh scripts/test-setup-macos-homebrew.sh: clean
  • actionlint .github/workflows/integration.yml .github/workflows/benchmarks.yml .github/workflows/ci.yml: clean
  • ./scripts/test-setup-macos-homebrew.sh: passes. When I disabled the PATH lookup in the script, the test failed.
  • The installer SHA-256 was computed from the raw install.sh at the pinned commit.
  • python3 scripts/test-provider-ci-workflow.py: passes
  • make docs-impact-check BASE=origin/master, make docs-check (with libs/mlx-swift-lm checked out shallow): pass
  • The first real proof is the Integration Tests run on this PR. It must start and reach its jobs, not end in startup_failure. E2E Benchmarks must also start.

Components touched

  • coordinator (Go)
  • provider (Rust, legacy)
  • provider-swift (Swift CLI)
  • console-ui (Next.js)
  • enclave (Swift)
  • infra / CI / release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated (docs/developer/build.md, docs/developer/test.md)
  • No documentation needed — reason:

Notes for reviewers

  • The install path needs non-interactive sudo on the runner, the same as the official installer. If a runner already has brew, the script downloads nothing.
  • To move the installer pin, change the commit and the SHA-256 in the script together.
  • This PR changes no deployment or production state.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The organization Actions policy does not allow
Homebrew/actions/setup-homebrew, so the integration and benchmark
workflows stopped at startup. scripts/setup-macos-homebrew.sh uses an
installed brew or installs Homebrew from a pinned, checksum-verified
installer, then exports its shellenv to later steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 30, 2026

Copy link
Copy Markdown

Deployment failed for project d-inference with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: d-inference.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@github-actions

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head 7a6239ac082a against base 1e4b2d885c38.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Scan incomplete: one or more configured reviewers did not finish; completed reviewers' findings are shown below

Reviewers: anthropic/claude-opus-5.5: incomplete (review unavailable); openai/gpt-6-astra: incomplete (review unavailable)

Models: anthropic/claude-opus-5.5, openai/gpt-6-astra. Findings require human validation; this review never requests changes or blocks merging.

@Gajesh2007
Gajesh2007 merged commit 5544167 into master Oct 1, 2026
20 of 27 checks passed
@Gajesh2007
Gajesh2007 deleted the ci/homebrew-without-action branch October 1, 2026 01:07
@davidtai davidtai mentioned this pull request Oct 1, 2026
8 of 16 tasks

This branch was successfully deployed

No deployments
benchmarks — 7a6239ac Deployed Sep 30, 2026 by davidtai via E2E Benchmarks #2029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants