-
-
Notifications
You must be signed in to change notification settings - Fork 207
141 lines (121 loc) · 3.79 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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)