Skip to content

Merge pull request #33 from chipsalliance/fix-verible-formula #45

Merge pull request #33 from chipsalliance/fix-verible-formula

Merge pull request #33 from chipsalliance/fix-verible-formula #45

Workflow file for this run

name: brew test-bot
on:
push:
branches:
- main
pull_request:
jobs:
test-bot:
strategy:
matrix:
# macos-13 is x86_64-based. macos-14+ is arm-based.
# See: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.0
with:
all_but_latest: true
access_token: ${{ github.token }}
- 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: ${{ matrix.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ matrix.os }}-rubygems-
- run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
- run: brew test-bot --only-tap-syntax
- run: brew test-bot --only-formulae
if: github.event_name == 'pull_request'
- name: Upload bottles as artifact
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: bottles_${{ matrix.os }}
path: '*.bottle.*'
# Add `pr-pull` label after `test-bot` job completes, if:
# - triggered by pull_request
# - pull_request is not a draft
# - pull_request is not from a fork (implies write permission)
# - pull_request contains `AUTO_MERGE` line in the PR body
label-auto-merge:
needs: test-bot
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Check pull request for AUTO_MERGE line
id: regex-match
uses: actions-ecosystem/action-regex-match@v2
with:
text: ${{ github.event.pull_request.body }}
regex: '^AUTO_MERGE$'
flags: 'm'
- name: Label pull request with pr-pull label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ steps.regex-match.outputs.match != '' }}
with:
github_token: ${{ secrets.WORKFLOW_TOKEN }}
labels: pr-pull