-
Notifications
You must be signed in to change notification settings - Fork 173
177 lines (154 loc) · 5.65 KB
/
runexamples.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: run examples
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
GO_VERSION: '1.20'
jobs:
run-examples:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "^${{ env.GO_VERSION }}"
- name: Build examples
shell: bash
working-directory: examples
run: |
go build -o 1-simplest/example-1 1-simplest/main.go
go build -o 2-clicks/example-2 2-clicks/main.go
go build -o 3-messaging/example-3-processor 3-messaging/cmd/processor/main.go
go build -o 3-messaging/example-3-service 3-messaging/cmd/service/main.go
go build -o 3-messaging/example-3-loadgen 3-messaging/cmd/loadgen/main.go
go build -o 3-messaging/example-3-block-user 3-messaging/cmd/block-user/main.go
go build -o 3-messaging/example-3-translate-word 3-messaging/cmd/translate-word/main.go
go build -o 5-multiple/example-5 5-multiple/main.go
go build -o 6-reconnecting-view/example-6 6-reconnecting-view/main.go
go build -o 7-redis/example-7 7-redis/*.go
go build -o 8-monitoring/example-8 8-monitoring/main.go
go build -o 9-defer-commit/example-9 9-defer-commit/main.go
go build -o 10-visit/example-10 10-visit/main.go
- name: Start services
shell: bash
working-directory: examples
run: |
make start
- name: Run example 1
uses: ./.github/actions/run-application
with:
file: example-1
wait-for: '"Processor example-group"'
working-directory: examples/1-simplest
- name: Run example 2
uses: ./.github/actions/run-application
with:
file: example-2
wait-for: '"Processor mini-group"'
working-directory: examples/2-clicks
# Example 3 is a more complex example consisting of multiple steps
- name: Start example 3 processors
id: run_example_3_processor
uses: ./.github/actions/run-application
with:
file: example-3-processor
args: -collector -blocker -filter -translator -detector
wait-for: '["Processor blocker", "Processor collector", "Processor message_filter", "Processor message_filter", "Processor message_filter"]'
working-directory: examples/3-messaging
terminate: false
- name: Start example 3 service
id: run_example_3_service
uses: ./.github/actions/run-application
with:
file: example-3-service
args: -sent
wait-for: '"Listen port 8080"'
working-directory: examples/3-messaging
terminate: false
- name: Start example 3 loadgen
id: run_example_3_loadgen
uses: ./.github/actions/run-application
with:
file: example-3-loadgen
wait-for: '"Posted message"'
working-directory: examples/3-messaging
terminate: false
- name: Run example 3 list users
shell: bash
working-directory: examples/3-messaging
run: |
curl localhost:8080/Alice/feed
- name: Run example 3 block user
shell: bash
working-directory: examples/3-messaging
run: |
./example-3-block-user -user Bob
- name: Run example 3 translate word
shell: bash
working-directory: examples/3-messaging
run: |
./example-3-translate-word -word "together" -with "t°9e+her"
- name: Stop example 3 loadgen
shell: bash
working-directory: examples/3-messaging
run: |
kill ${{ steps.run_example_3_loadgen.outputs.pid }}
- name: Stop example 3 service
shell: bash
working-directory: examples/3-messaging
run: |
kill ${{ steps.run_example_3_service.outputs.pid }}
- name: Stop example 3 processors
shell: bash
working-directory: examples/3-messaging
run: |
kill ${{ steps.run_example_3_processor.outputs.pid }}
- name: Run example 4
shell: bash
working-directory: examples/4-tests
run: |
go test example_test.go
- name: Run example 5
uses: ./.github/actions/run-application
with:
file: example-5
wait-for: '"Processor multiInput"'
working-directory: examples/5-multiple
- name: Run example 6
uses: ./.github/actions/run-application
with:
file: example-6
wait-for: '"View is in state"'
working-directory: examples/6-reconnecting-view
- name: Run example 7
uses: ./.github/actions/run-application
with:
file: example-7
wait-for: '"Processor examples"'
working-directory: examples/7-redis
- name: Run example 8
uses: ./.github/actions/run-application
with:
file: example-8
wait-for: '["Processor mini-group-stateless", "Processor mini-group-join", "Processor mini-group"]'
working-directory: examples/8-monitoring
- name: Run example 9
uses: ./.github/actions/run-application
with:
file: example-9
wait-for: '["Processor forwarder", "Processor consumer"]'
working-directory: examples/9-defer-commit
- name: Run example 10
uses: ./.github/actions/run-application
with:
file: example-10
wait-for: '"Processor example-visit-group"'
working-directory: examples/10-visit
- name: Stop services
shell: bash
working-directory: examples
run: |
make stop