Homebrew/homebrew-brewdler

View on GitHub
.github/workflows/tests.yml

Summary

Maintainability
Test Coverage
name: CI
on:
  push:
    branches: master
  pull_request:
permissions:
  contents: read

jobs:
  tests:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest]

    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-tap-syntax

    - name: Set up Ruby
      uses: ruby/setup-ruby@78c01b705fd9d5ad960d432d3a0cfa341d50e410 # v1.179.1
      with:
        bundler-cache: true

    - name: Run RSpec tests
      run: bundle exec rspec

    - uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c
      if: always()

    - name: Test that installing works
      run: |
        echo 'brew "hello"' > ./Brewfile
        brew bundle
        hello