-
Notifications
You must be signed in to change notification settings - Fork 220
334 lines (334 loc) · 10.3 KB
/
tests-workflow.yml
File metadata and controls
334 lines (334 loc) · 10.3 KB
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
name: unit-integration-tests
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
branches:
- develop
paths:
- 'src/**'
- 'packages/**'
- 'jobs/**'
- 'config/**'
- 'scripts/**'
- '.github/workflows/**'
- '.github/helpers/**'
env:
MAPPING: |
build_nats_server=src/code.cloudfoundry.org/vendor/github.com/nats-io/nats-server/v2
FLAGS: |
--keep-going
--trace
-r
--fail-on-pending
--randomize-all
--nodes=7
--race
--timeout 30m
--flake-attempts 2
RUN_AS: root
VERIFICATIONS: |
verify_go repo/$DIR
verify_gofmt repo/$DIR
verify_govet repo/$DIR
verify_staticcheck repo/$DIR
FUNCTIONS: ci/diego-release/helpers/build-binaries.bash
DB: ""
jobs:
repo-clone:
runs-on: ubuntu-latest
steps:
- name: diego-release-repo
uses: actions/checkout@v4.3.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
submodules: recursive
path: repo
- name: Check out wg-appruntime code
uses: actions/checkout@v4.3.1
with:
repository: cloudfoundry/wg-app-platform-runtime-ci
path: ci
- name: zip repo artifacts
run: |
tar -czf repo-artifact.tar.gz repo
tar -czf ci-artifact.tar.gz ci
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: repo
path: |
repo-artifact.tar.gz
ci-artifact.tar.gz
determine-image-tag:
if: contains(github.event.pull_request.labels.*.name, 'ready-to-run')
runs-on: ubuntu-latest
outputs:
go_version: ${{ steps.get-version.outputs.go_version }}
steps:
- name: checkout ci repo
uses: actions/checkout@v4.3.1
with:
repository: cloudfoundry/wg-app-platform-runtime-ci
sparse-checkout: go-version.json
sparse-checkout-cone-mode: false
- name: get-version
id: get-version
run: |
version=$(jq -r '.releases["diego"] // .default' go-version.json)
echo "go_version=${version}" >> "$GITHUB_OUTPUT"
template-tests:
runs-on: ubuntu-latest
needs: [repo-clone]
container: cloudfoundry/tas-runtime-build:latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: template-tests
run: |
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-tests-templates/task.bash
lint-repo:
runs-on: ubuntu-latest
needs: [repo-clone]
container: cloudfoundry/tas-runtime-build:latest
env:
LINTERS: |
sync-package-specs.bash
sync-submodule-config.bash
match-golang-os-package-versions.bash
check-envoy-versions.bash
check-for-windows-drift.bash
check-proto-files.bash
check-metrics-documentation.bash
check-expiring-certs.bash
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: lint-repo
run: |
"${GITHUB_WORKSPACE}"/ci/shared/tasks/lint-repo/task.bash
test-on-mysql-5-7:
if: contains(github.event.pull_request.labels.*.name, 'ready-to-run')
runs-on: ubuntu-latest
needs: [repo-clone, determine-image-tag]
env:
BUILD_IMAGE: cloudfoundry/tas-runtime-mysql-5.7:${{ needs.determine-image-tag.outputs.go_version }}
DB_USER: root
DB_PASSWORD: password
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: pull image
run: docker pull "$BUILD_IMAGE"
- name: build binaries
run: |
repo/.github/helpers/build.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: bbs-mysql
env:
DIR: src/code.cloudfoundry.org/bbs
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: auctioneer-mysql
env:
DIR: src/code.cloudfoundry.org/auctioneer
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: rep-mysql
env:
DIR: src/code.cloudfoundry.org/rep
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: route-emitter-mysql
env:
DIR: src/code.cloudfoundry.org/route-emitter
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: locket-mysql
env:
DIR: src/code.cloudfoundry.org/locket
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: cfdot-mysql
env:
DIR: src/code.cloudfoundry.org/cfdot
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
test-repos-withoutdb:
if: contains(github.event.pull_request.labels.*.name, 'ready-to-run')
runs-on: ubuntu-latest
needs: [repo-clone, determine-image-tag]
env:
BUILD_IMAGE: cloudfoundry/tas-runtime-build:${{ needs.determine-image-tag.outputs.go_version }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: pull image
run: docker pull "$BUILD_IMAGE"
- name: build binaries
run: |
repo/.github/helpers/build.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: auction
env:
DIR: src/code.cloudfoundry.org/auction
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: executor
env:
DIR: src/code.cloudfoundry.org/executor
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: diego-ssh
env:
DIR: src/code.cloudfoundry.org/diego-ssh
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: fileserver
env:
DIR: src/code.cloudfoundry.org/fileserver
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: healthcheck
env:
DIR: src/code.cloudfoundry.org/healthcheck
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
test-on-postgres:
if: contains(github.event.pull_request.labels.*.name, 'ready-to-run')
runs-on: ubuntu-latest
needs: [repo-clone, determine-image-tag]
env:
BUILD_IMAGE: cloudfoundry/tas-runtime-postgres:${{ needs.determine-image-tag.outputs.go_version }}
DB_USER: postgres
DB_PASSWORD: ""
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: pull image
run: docker pull "$BUILD_IMAGE"
- name: build binaries
run: |
repo/.github/helpers/build.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: bbs-postgres
env:
DIR: src/code.cloudfoundry.org/bbs
DB: postgres
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: auctioneer-postgres
env:
DIR: src/code.cloudfoundry.org/auctioneer
DB: postgres
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: rep-postgres
env:
DIR: src/code.cloudfoundry.org/rep
DB: postgres
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: route-emitter-postgres
env:
DIR: src/code.cloudfoundry.org/route-emitter
DB: postgres
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: locket-postgres
env:
DIR: src/code.cloudfoundry.org/locket
DB: postgres
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: cfdot-postgres
env:
DIR: src/code.cloudfoundry.org/cfdot
DB: postgres
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
test-on-mysql-8-0:
if: contains(github.event.pull_request.labels.*.name, 'ready-to-run')
runs-on: ubuntu-latest
needs: [repo-clone, determine-image-tag]
env:
BUILD_IMAGE: cloudfoundry/tas-runtime-mysql-8.0:${{ needs.determine-image-tag.outputs.go_version }}
DB_USER: root
DB_PASSWORD: password
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: pull image
run: docker pull "$BUILD_IMAGE"
- name: build binaries
run: |
repo/.github/helpers/build.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: bbs-mysql
env:
DIR: src/code.cloudfoundry.org/bbs
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: auctioneer-mysql
env:
DIR: src/code.cloudfoundry.org/auctioneer
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: rep-mysql
env:
DIR: src/code.cloudfoundry.org/rep
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: route-emitter-mysql
env:
DIR: src/code.cloudfoundry.org/route-emitter
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: locket-mysql
env:
DIR: src/code.cloudfoundry.org/locket
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"
- name: cfdot-mysql
env:
DIR: src/code.cloudfoundry.org/cfdot
DB: mysql
run: |
repo/.github/helpers/test.bash ${{ github.workspace }} "$BUILD_IMAGE"