Skip to content

Commit

Permalink
ci(tests): isolate the syntax check / parallelise the check of formulae
Browse files Browse the repository at this point in the history
  • Loading branch information
tgragnato committed Sep 7, 2024
1 parent f446efc commit 99c6d71
Showing 1 changed file with 52 additions and 7 deletions.
59 changes: 52 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ on:
jobs:

test-bot:
strategy:
matrix:
os: [ macos-12, macos-13, macos-14, ubuntu-latest ]
runs-on: ${{ matrix.os }}

name: Homebrew Test Bot (Syntax)
runs-on: ubuntu-latest

steps:

Expand All @@ -37,8 +36,54 @@ jobs:

- run: brew test-bot --only-setup

- run: brew test-bot --only-tap-syntax
- name: Test syntax of all formulae
run: brew test-bot --only-tap-syntax

get-formulas:

runs-on: ubuntu-latest
outputs:
formulas: ${{ steps.get-formulas.outputs.formulas }}

steps:
- name: Check out repository
uses: actions/checkout@v4

- run: brew test-bot --only-formulae --root-url=https://ghcr.io/v2/tgragnato/tap amule
- name: Get list of all formulae
id: get-formulas
run: |
FORMULAS=$(ls Formula | sed 's/\.rb$//')
FORMULAS_JSON=$(echo $FORMULAS | jq -R -s -c 'split(" ")')
echo "::set-output name=formulas::$FORMULAS_JSON"
test-formulae:

name: Homebrew Test Bot (Formulae)
needs: [test-bot, get-formulas]
if: success()
strategy:
matrix:
os: [ macos-12, macos-13, macos-14, ubuntu-latest ]
formula: ${{fromJson(needs.get-formulas.outputs.formulas)}}
runs-on: ${{ matrix.os }}

steps:

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
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 test-bot --only-formulae --root-url=https://ghcr.io/v2/tgragnato/tap magnetico
- name: Test formula ${{ matrix.formula }}
run: brew test-bot --only-formulae ${{ matrix.formula }}

0 comments on commit 99c6d71

Please sign in to comment.