Merge pull request #583 from marlonrichert/patch-1 #782
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: master | |
pull_request: | |
jobs: | |
tap_syntax: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/homebrew/ubuntu22.04:master | |
env: | |
HOMEBREW_SIMULATE_MACOS_ON_LINUX: 1 | |
steps: | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- run: brew test-bot --only-tap-syntax | |
rspec_tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Ruby | |
if: matrix.os == 'ubuntu-latest' | |
uses: ruby/setup-ruby@master | |
with: | |
ruby-version: '2.6' | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Cache Homebrew Bundler RubyGems | |
id: cache | |
uses: actions/cache@v3 | |
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 | |
- name: Install Bundler | |
run: gem install bundler -v "~>1" | |
- name: Install Homebrew/homebrew-services RubyGems | |
run: bundle install --jobs 4 --retry 3 | |
- name: Run Homebrew/homebrew-services RSpec tests | |
run: bundle exec rspec | |
functional_tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
HOMEBREW_NO_INSTALL_FROM_API: 1 | |
steps: | |
- name: Enable linger | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
loginctl enable-linger $(whoami) | |
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus" >> $GITHUB_ENV | |
- name: Set up Ruby | |
if: matrix.os == 'ubuntu-latest' | |
uses: ruby/setup-ruby@master | |
with: | |
ruby-version: '2.6' | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Cache Homebrew Bundler RubyGems | |
id: cache | |
uses: actions/cache@v3 | |
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 | |
- name: Unlink services repo | |
run: | | |
rm $(brew --repo homebrew/services) | |
cp -a $PWD $(brew --repo homebrew/services) | |
- name: Test start command | |
run: | | |
brew install consul | |
brew services start consul | |
brew services list | grep consul | |
sleep 5 | |
consul kv get -recurse | |
- name: Test restart command | |
run: | | |
brew services stop consul | |
sleep 5 | |
brew services run consul | |
brew services restart consul | |
brew services list | grep consul | |
sleep 5 | |
consul kv get -recurse | |
- name: Test stop command | |
run: | | |
brew services stop consul | |
sleep 5 | |
brew services list | grep consul | grep none | |
- name: Test run command | |
run: | | |
brew services run consul | |
sleep 5 | |
consul kv get -recurse | |
brew services stop consul | |
- name: Test list command | |
run: | | |
brew services | grep consul | |
- name: Test info command | |
run: | | |
brew services info consul | grep consul | |
brew services info consul --verbose | grep consul | |
brew services info consul --json | ruby -e "require 'json'" -e "puts JSON.parse(ARGF.read)" | |
- name: Link services repo | |
run: | | |
rm -rf $(brew --repo homebrew/services) | |
ln -s $PWD $(brew --repo homebrew/services) |