From e6420932bf3f0b2e384cb341a23cc561f5238bb4 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 7 Apr 2025 17:09:56 +0100 Subject: [PATCH] Add `brew bundle` and `brew services` integration tests We've had a few regressions in `brew bundle` and `brew services` recently that would have been caught by actual integration tests. This is similar to the "default formula" jobs but we want to run outside of those containers so we can run e.g. systemd. This will avoid bloating the runtime of already longer-running jobs. --- .github/workflows/actionlint.yml | 5 ++-- .github/workflows/tests.yml | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index 2923076fcb..6b80b38755 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -2,9 +2,8 @@ name: actionlint on: push: - paths: - - '.github/workflows/*.ya?ml' - - '.github/actionlint.yaml' + branches: + - master pull_request: paths: - '.github/workflows/*.ya?ml' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 760959cb28..c61bc01c46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -398,6 +398,54 @@ jobs: - run: brew test-bot --only-formulae --only-json-tab --test-default-formula + test-brew-bundle-services: + name: ${{ matrix.name }} + needs: syntax + if: github.repository_owner == 'Homebrew' && github.event_name != 'push' + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + include: + - name: test brew bundle and brew services (Ubuntu) + runs-on: ubuntu-latest + - name: test brew bundle and brew services (macOS) + runs-on: macos-15 + steps: + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + with: + core: true + cask: false + test-bot: false + + - run: brew test-bot --only-cleanup-before + + - run: brew test-bot --only-setup + + - name: Run brew bundle and brew services integration tests + run: | + cat <> Brewfile + brew "git" + brew "memcached", restart_service: true + brew "postgresql@15", restart_service: true + cask "1password" + cask "1password-cli" + cask "google-chrome" + # VSCode cask is not available on Linux. + vscode "github.copilot" if OS.mac? + EOS + + brew bundle check && exit 1 + brew bundle check --verbose && exit 1 + brew bundle list + brew bundle --verbose + brew services list + brew bundle env | grep PATH | grep git + brew bundle env --install + brew bundle exec --services true + brew services list + test-analytics: runs-on: ${{ matrix.os }} strategy: