Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import brew formula-analytics and generate-analytics-api commands #19259

Merged
merged 3 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ updates:
interval: daily
allow:
- dependency-type: all

- package-ecosystem: pip
directory: /Library/Homebrew/formula-analytics/
schedule:
interval: daily
allow:
- dependency-type: all
48 changes: 43 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ jobs:
run: |
brew tap homebrew/bundle
brew tap homebrew/command-not-found
brew tap homebrew/formula-analytics
brew tap homebrew/portable-ruby
brew tap homebrew/services

Expand All @@ -129,7 +128,6 @@ jobs:
homebrew/test-bot

brew style homebrew/command-not-found \
homebrew/formula-analytics \
homebrew/portable-ruby

- name: Run brew style on homebrew/cask
Expand Down Expand Up @@ -182,9 +180,6 @@ jobs:
run: |
brew audit --skip-style --except=version --tap=homebrew/cask

- name: Generate formula API
run: brew generate-formula-api --dry-run

- name: Generate cask API
run: brew generate-cask-api --dry-run

Expand Down Expand Up @@ -398,3 +393,46 @@ jobs:
- run: brew install gnu-tar

- run: brew test-bot --only-formulae --only-json-tab --test-default-formula

test-analytics:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
needs: syntax
if: github.repository_owner == 'Homebrew' && github.event_name != 'push'
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Setup Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version-file: ${{ steps.set-up-homebrew.outputs.repository-path }}/Library/Homebrew/formula-analytics/.python-version

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-

- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems

- run: brew formula-analytics --setup

- run: brew formula-analytics --install --json --days-ago=2
if: github.event.pull_request.head.repo.fork == false && (github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]')
env:
HOMEBREW_INFLUXDB_TOKEN: ${{ secrets.HOMEBREW_INFLUXDB_READ_TOKEN }}

- run: brew generate-analytics-api
if: github.event.pull_request.head.repo.fork == false && (github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]')
env:
HOMEBREW_INFLUXDB_TOKEN: ${{ secrets.HOMEBREW_INFLUXDB_READ_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
**/vendor/bundle/ruby/*/gems/prism-*/
**/vendor/bundle/ruby/*/gems/psych-*/
**/vendor/bundle/ruby/*/gems/pry-*/
**/vendor/bundle/ruby/*/gems/pycall-*/
**/vendor/bundle/ruby/*/gems/racc-*/
**/vendor/bundle/ruby/*/gems/rainbow-*/
**/vendor/bundle/ruby/*/gems/rbi-*/
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ end
group :vscode, optional: true do
gem "ruby-lsp", require: false
end
group :formula_analytics, optional: true do
gem "pycall", require: false
end

# shared gems (used by multiple groups)
group :audit, :bump_unversioned_casks, :livecheck, optional: true do
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.1)
pycall (1.5.2)
racc (1.8.1)
rainbow (3.1.1)
rbi (0.2.4)
Expand Down Expand Up @@ -152,6 +153,7 @@ GEM

PLATFORMS
aarch64-linux
arm-linux
arm64-darwin
x86_64-darwin
x86_64-linux
Expand All @@ -168,6 +170,7 @@ DEPENDENCIES
patchelf
plist
pry
pycall
redcarpet
rexml
rspec
Expand Down
Loading
Loading