mirror of
https://github.com/ivuorinen/homebrew-tap.git
synced 2026-01-26 11:24:02 +00:00
96 lines
2.7 KiB
YAML
96 lines
2.7 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
|
|
|
|
env:
|
|
HOMEBREW_DEVELOPER: 1
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
HOMEBREW_NO_ENV_HINTS: 1
|
|
|
|
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: Setup Ruby
|
|
uses: ruby/setup-ruby@0481980f17b760ef6bca5e8c55809102a0af1e5a # v1.263.0
|
|
with:
|
|
bundler-cache: true
|
|
ruby-version-file: .ruby-version
|
|
|
|
- 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
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
run: brew install-bundler-gems
|
|
|
|
- name: Install project gems
|
|
shell: bash
|
|
run: |
|
|
export GEM_HOME="$HOME/.gem"
|
|
export PATH="$GEM_HOME/bin:$PATH"
|
|
gem install bundler --user-install
|
|
bundle install
|
|
|
|
- name: Run brew test-bot (cleanup)
|
|
shell: bash
|
|
run: brew test-bot --only-cleanup-before
|
|
|
|
- name: Run brew test-bot (setup)
|
|
shell: bash
|
|
run: brew test-bot --only-setup
|
|
|
|
- name: Run brew test-bot (tap syntax)
|
|
shell: bash
|
|
run: brew test-bot --only-tap-syntax
|
|
|
|
- name: Check for real formulae (non-examples)
|
|
id: check-formulae
|
|
shell: bash
|
|
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
|
|
shell: bash
|
|
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.*"
|