forked from kubeedge/kubeedge
-
Notifications
You must be signed in to change notification settings - Fork 1
314 lines (263 loc) · 8.63 KB
/
main.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
name: Main CI WorkFlow
on:
push:
branches:
- master
tags:
paths-ignore:
- '**.md'
- 'docs/**'
- '**/OWNERS'
- '**/MAINTAINERS'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
- '**/OWNERS'
- '**/MAINTAINERS'
env:
CONTAINER_RUN_OPTIONS: " "
GINKGO_VERSION: "v1.16.4"
jobs:
lint:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Verify vendor, licenses, do lint
env:
GOPATH: /home/runner/work/${{ github.repository }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17.x
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependences
run: |
sudo apt-get install -y jq
- name: Run verify test
run: make verify
working-directory: ./src/github.com/${{ github.repository }}
- name: Run lint test
run: make lint
working-directory: ./src/github.com/${{ github.repository }}
image-prepare:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Prepare kubeedge/build-tools image
steps:
- name: Pull kubeedge/build-tools image
run: |
docker pull kubeedge/build-tools:1.17.13-ke1
mkdir -p /home/runner/build-tools/
docker save kubeedge/build-tools:1.17.13-ke1 > /home/runner/build-tools/build-tools.tar
- name: Temporarily save kubeedge/build-tools image
uses: actions/upload-artifact@v3
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
build:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Multiple build
needs: image-prepare
steps:
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v3
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
- run: make
- run: make smallbuild
- run: make crossbuild
- run: make crossbuild ARM_VERSION=GOARM7
- run: make crossbuild WHAT=cloudcore ARM_VERSION=GOARM8
basic_test:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Unit test, integration test edge
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17.x
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependences
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: make test PROFILE=y
- name: Upload coverage to Codecov
# Prevent running from the forked repository that doesn't need to upload coverage.
# In addition, running on the forked repository would fail as missing the necessary secret.
if: ${{ github.repository == 'kubeedge/kubeedge' }}
uses: codecov/codecov-action@v3
with:
# Even though token upload token is not required for public repos,
# but adding a token might increase successful uploads as per:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
token: ${{secrets.CODECOV_UPLOAD_TOKEN}}
files: ./coverage.out
flags: unittests
fail_ci_if_error: true
verbose: true
- run: make integrationtest
e2e_test:
runs-on: ubuntu-22.04
strategy:
matrix:
PROTOCOL:
- WebSocket
- QUIC
timeout-minutes: 30
name: E2e test
needs: image-prepare
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17.x
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependences
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v3
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
# for QUIC protocol, we will use docker as edgecore container runtime
# for WebSocket protocol, we will use containerd as edgecore container runtime
# just for covering both docker and CRI runtime e2e cases
- run: |
export PROTOCOL=${{ matrix.PROTOCOL }}
if [[ ${{ matrix.PROTOCOL }} == "QUIC" ]]; then
export CONTAINER_RUNTIME="docker"
elif [[ ${{ matrix.PROTOCOL }} == "WebSocket" ]]; then
export CONTAINER_RUNTIME="remote"
fi
make e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ matrix.PROTOCOL }}-e2e-test-logs
path: |
/tmp/cloudcore.log
/tmp/edgecore.log
keadm_deprecated_e2e_test:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Keadm deprecated e2e test
needs: image-prepare
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17.x
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependences
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v3
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
- run: make keadm_deprecated_e2e
keadm_e2e_test:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Keadm e2e test
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.17.x
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependences
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.4.0
- run: make keadm_e2e
docker_build:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Multiple docker image build
steps:
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: make image