-
Notifications
You must be signed in to change notification settings - Fork 84
204 lines (195 loc) · 6.39 KB
/
plugin-tests.yaml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Plugin Tests
concurrency:
group: plugins-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
jobs:
build:
name: Build Plugin Test On ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-12]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install docker
brew install colima
colima start
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Build
run: make -C test/plugins build
- uses: actions/upload-artifact@v2
name: Upload Test Base
with:
name: test-tools-${{ matrix.os }}
path: |
test/plugins/dist
test:
if: always()
name: ${{ matrix.case }}
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
matrix:
case:
- gin
- http
- dubbo
- go-redisv9
- go-restfulv3
- gorm
- kratosv2
- microv4
- mongo
- mysql
- zap
- logrus
- plugin_exclusion
- runtime_metrics
- mux
- grpc
- irisv12
- trace-activation
- fasthttp
- discard-reporter
- fiber
- echov4
- rocketmq
- amqp
- pulsar
- segmentio-kafka
- go-elasticsearchv8
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/download-artifact@v2
with:
name: test-tools-ubuntu-latest
path: test/plugins/dist
- name: Setup Tools
run: |
chmod +x test/plugins/dist/*
if ls test/plugins/dist/skywalking-agent-test-validator-1.0.0.tgz; then
docker load -i test/plugins/dist/skywalking-agent-test-validator-1.0.0.tgz
fi
- name: Install docker-compose
shell: bash
run: |
if ! command docker-compose 2>&1 > /dev/null; then
echo "Installing docker-compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
- name: Run Test
run: bash test/plugins/run.sh ${{ matrix.case }}
- uses: actions/upload-artifact@v2
name: Upload Agent
if: ${{ failure() }}
with:
path: test/plugins/workspace
name: test-plugins-workspace-${{ matrix.case }}-ubuntu
test-on-macos:
if: always()
name: gin-macos
needs:
- build
runs-on: macos-12
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/download-artifact@v2
with:
name: test-tools-macos-12
path: test/plugins/dist
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install docker docker-compose
brew install colima
colima start
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Setup Tools
run: |
chmod +x test/plugins/dist/*
if ls test/plugins/dist/skywalking-agent-test-validator-1.0.0.tgz; then
docker load -i test/plugins/dist/skywalking-agent-test-validator-1.0.0.tgz
fi
- name: Install docker-compose
shell: bash
run: |
if ! command docker-compose 2>&1 > /dev/null; then
echo "Installing docker-compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
- name: Run Test
run: bash test/plugins/run.sh short_versions_gin
- uses: actions/upload-artifact@v2
name: Upload Agent
if: ${{ failure() }}
with:
path: test/plugins/workspace
name: test-plugins-workspace-gin-macos
required:
if: always()
name: Plugin Tests
needs:
- test
- test-on-macos
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Merge Requirement
run: |
if [[ ${{ needs.test.result }} != 'success' || ${{ needs.test-on-macos.result }} != 'success' ]]; then
exit -1
fi