-
-
Notifications
You must be signed in to change notification settings - Fork 208
109 lines (95 loc) · 2.81 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
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 Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up Ruby
uses: ruby/setup-ruby@46ca53beb334a2329bcd0e46a694816a6ae6d173 # v1.201.0
with:
bundler-cache: true
- 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 Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up Ruby
uses: ruby/setup-ruby@46ca53beb334a2329bcd0e46a694816a6ae6d173 # v1.201.0
with:
bundler-cache: true
- 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)"