Files
homebrew-tap/.github/workflows/ci.yml
Ismo Vuorinen 6dc9a170cc chore: fixes, several improvements and refactorings (#2)
* chore: fixes

* chore: rubocop fixes, linting, etc.

* chore: switching to use `brew style` only

* chore: use `brew style` for linting, skip example formulae in ci.yml

* chore(lint): fixes, additions and tweaks
2025-09-23 11:29:53 +03:00

70 lines
2.0 KiB
YAML

---
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
test-bot:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14]
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: write
actions: read
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@main
- name: Cache Homebrew Bundler RubyGems
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
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
run: brew install-bundler-gems
- name: Run brew test-bot (cleanup)
run: brew test-bot --only-cleanup-before
- name: Run brew test-bot (setup)
run: brew test-bot --only-setup
- name: Run brew test-bot (tap syntax)
run: brew test-bot --only-tap-syntax
- name: Check for real formulae (non-examples)
id: check-formulae
run: |
# Count formulae that are not example formulae
REAL_FORMULAE=$(find Formula -name "*.rb" ! -name "example-*.rb" | wc -l | tr -d ' ')
echo "real_formulae_count=$REAL_FORMULAE" >> "$GITHUB_OUTPUT"
echo "Found $REAL_FORMULAE real formulae (excluding examples)"
- name: Run brew test-bot (formulae)
if: github.event_name == 'pull_request' && steps.check-formulae.outputs.real_formulae_count > 0
run: brew test-bot --only-formulae
- name: Upload bottles as artifact
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: bottles_${{ matrix.os }}
path: "*.bottle.*"