forked from Apicurio/apicurio-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
480 lines (400 loc) · 19.4 KB
/
verify.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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
name: Verify Build Workflow
on:
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'docs/**'
- '.github/workflows/**'
branches: ['2.6.x']
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'docs/**'
branches: ['2.6.x']
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TESTCONTAINERS_RYUK_DISABLED: true
jobs:
build-verify:
name: Verify In Memory Build
runs-on: ubuntu-20.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
if: github.event_name == 'push'
id: buildx
uses: docker/setup-buildx-action@v1
- name: Inspect builder
if: github.event_name == 'push'
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and Test In Memory Variant
# if: github.ref == 'refs/heads/main'
run: make BUILD_FLAGS='-DskipCommitIdPlugin=false -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-in-memory
# - name: Build and Test In Memory Variant Without UI
# if: github.ref != 'refs/heads/main'
# run: make BUILD_FLAGS='-DskipUiBuild -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-in-memory
- name: Login to DockerHub Registry
if: github.event_name == 'push'
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build and Push In Memory Multi-arch Images to Docker.io
if: github.event_name == 'push'
run: ./.github/scripts/build-and-push-multiarch-images.sh ${GITHUB_REF#refs/heads/} docker.io mem-multiarch-images snapshot
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Build and Push In Memory Multi-arch Images to Quay.io
if: github.event_name == 'push'
run: ./.github/scripts/build-and-push-multiarch-images.sh ${GITHUB_REF#refs/heads/} quay.io mem-multiarch-images snapshot
build-verify-sql:
name: Verify SQL Build
runs-on: ubuntu-20.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
if: github.event_name == 'push'
id: buildx
uses: docker/setup-buildx-action@v1
- name: Inspect builder
if: github.event_name == 'push'
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and Test SQL Variant
# if: github.ref == 'refs/heads/main'
run: make BUILD_FLAGS='-DskipCommitIdPlugin=false -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-sql
# - name: Build and Test SQL Variant Without UI
# if: github.ref != 'refs/heads/main'
# run: make BUILD_FLAGS='-DskipUiBuild -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-sql
- name: Login to DockerHub Registry
if: github.event_name == 'push'
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build and Push SQL Multi-arch Images to Docker.io
if: github.event_name == 'push'
run: ./.github/scripts/build-and-push-multiarch-images.sh ${GITHUB_REF#refs/heads/} docker.io sql-multiarch-images snapshot
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Build and Push In Memory Multi-arch Images to Quay.io
if: github.event_name == 'push'
run: ./.github/scripts/build-and-push-multiarch-images.sh ${GITHUB_REF#refs/heads/} quay.io sql-multiarch-images snapshot
build-verify-kafkasql:
name: Verify KafkaSQL Build
runs-on: ubuntu-20.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
if: github.event_name == 'push'
id: buildx
uses: docker/setup-buildx-action@v1
- name: Inspect builder
if: github.event_name == 'push'
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and Test KafkaSQL Variant
# if: github.ref == 'refs/heads/main'
run: make BUILD_FLAGS='-DskipCommitIdPlugin=false -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-kafkasql
# - name: Build and Test KafkaSQL Variant Without UI
# if: github.ref != 'refs/heads/main'
# run: make BUILD_FLAGS='-DskipUiBuild -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-kafkasql
- name: Login to DockerHub Registry
if: github.event_name == 'push'
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build and Push KafkaSQL Multi-arch Images to Docker.io
if: github.event_name == 'push'
run: ./.github/scripts/build-and-push-multiarch-images.sh ${GITHUB_REF#refs/heads/} docker.io kafkasql-multiarch-images snapshot
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Build and Push KafkaSQL Multi-arch Images to Quay.io
if: github.event_name == 'push'
run: ./.github/scripts/build-and-push-multiarch-images.sh ${GITHUB_REF#refs/heads/} quay.io kafkasql-multiarch-images snapshot
build-mem-native-images:
name: Build and Test In Memory native images
runs-on: ubuntu-20.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Workaround jackson-coreutils
run: |
# upstream issue: https://github.com/java-json-tools/jackson-coreutils/issues/59
rm -rf ~/.m2/repository/com/github/java-json-tools
mkdir -p /tmp/coreutils-workaround
( cd /tmp/coreutils-workaround && mvn dependency:get -DremoteRepositories=https://repo1.maven.org/maven2 -Dartifact=com.github.java-json-tools:jackson-coreutils:2.0 )
- name: Build inmemory Variant
# if: github.ref == 'refs/heads/main'
run: make SKIP_TESTS=true BUILD_FLAGS='-DskipCommitIdPlugin=false -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-in-memory
# - name: Build inmemory Variant Without UI
# if: github.ref != 'refs/heads/main'
# run: make SKIP_TESTS=true BUILD_FLAGS='-DskipUiBuild -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5 --no-transfer-progress' build-in-memory
- name: Verify docs generation
run: |
if [ -n "$(git status --untracked-files=no --porcelain docs)" ]; then
echo "Docs needs to be regenerated. Run 'mvn clean install -pl docs -am -DskipTests' and commit the resulting files in the 'docs' folder."
git --no-pager diff docs
exit 1
fi
- name: Build Native executables
# if: github.ref == 'refs/heads/main'
run: make SKIP_TESTS=true build-mem-native
# - name: Build Native executables without UI
# if: github.ref != 'refs/heads/main'
# run: make SKIP_TESTS=true BUILD_FLAGS='-DskipUiBuild' build-mem-native
- name: Build and Push Temporary image for testing
env:
IMAGE_REPO: ttl.sh/${{ github.sha }}
# maximum allowed
IMAGE_TAG: 1d
run: make build-mem-native-image push-mem-native-image
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.31.1'
kubernetes version: 'v1.26.3'
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: Prepare minikube tunnel
run: minikube tunnel &> /dev/null &
- name: Run Integration Tests - inmemory
run: make REGISTRY_IMAGE='-Dregistry-in-memory-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-mem-native:1d' run-in-memory-integration-tests
- name: Run Integration Tests - inmemory - auth
run: make REGISTRY_IMAGE='-Dregistry-in-memory-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-mem-native:1d' run-in-memory-auth-tests
- name: Collect logs
if: failure()
run: ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs
path: artifacts
- name: Build Native Images
env:
IMAGE_REPO: quay.io
IMAGE_TAG: 2.6.x-snapshot
ADDITIONAL_IMAGE_TAG: latest-snapshot
run: |
make build-mem-native-image
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Push Native Images
env:
IMAGE_REPO: quay.io
IMAGE_TAG: 2.6.x-snapshot
ADDITIONAL_IMAGE_TAG: latest-snapshot
if: github.event_name == 'push'
run: |
make push-mem-native-image
- name: List All The Images
run: docker images
build-sql-native-images:
name: Build and Test SQL native images
runs-on: ubuntu-20.04
if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
steps:
- name: Checkout Code with Ref '${{ github.ref }}'
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Workaround jackson-coreutils
run: |
# upstream issue: https://github.com/java-json-tools/jackson-coreutils/issues/59
rm -rf ~/.m2/repository/com/github/java-json-tools
mkdir -p /tmp/coreutils-workaround
( cd /tmp/coreutils-workaround && mvn dependency:get -DremoteRepositories=https://repo1.maven.org/maven2 -Dartifact=com.github.java-json-tools:jackson-coreutils:2.0 )
- name: Build Sql Variant
# if: github.ref == 'refs/heads/main'
run: make SKIP_TESTS=true BUILD_FLAGS='-Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-sql
# - name: Build Sql Variant Without UI
# if: github.ref != 'refs/heads/main'
# run: make SKIP_TESTS=true BUILD_FLAGS='-DskipUiBuild -Dmaven.javadoc.skip=true --no-transfer-progress -Dmaven.wagon.httpconnectionManager.maxTotal=30 -Dmaven.wagon.http.retryHandler.count=5' build-sql
- name: Verify docs generation
run: |
if [ -n "$(git status --untracked-files=no --porcelain docs)" ]; then
echo "Docs needs to be regenerated. Run 'mvn clean install -pl docs -am -DskipTests' and commit the resulting files in the 'docs' folder."
git --no-pager diff docs
exit 1
fi
- name: Build Native executables
# if: github.ref == 'refs/heads/main'
run: make SKIP_TESTS=true build-sql-native
# - name: Build Native executables without UI
# if: github.ref != 'refs/heads/main'
# run: make SKIP_TESTS=true BUILD_FLAGS='-DskipUiBuild' build-sql-native
- name: Build and Push Temporary image for testing
env:
IMAGE_REPO: ttl.sh/${{ github.sha }}
# maximum allowed
IMAGE_TAG: 1d
run: make build-sql-native-image push-sql-native-image
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.31.1'
kubernetes version: 'v1.26.3'
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: Prepare minikube tunnel
run: minikube tunnel &> /dev/null &
- name: Run Integration Tests - sql
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql-native:1d' run-sql-integration-tests
- name: Run Integration Tests - sql auth
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql-native:1d' run-sql-auth-tests
- name: Run Integration Tests - sql migration
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql-native:1d' run-sql-migration-integration-tests
- name: Run Integration Tests - sql multitenancy
run: make REGISTRY_IMAGE='-Dregistry-sql-image=ttl.sh/${{ github.sha }}/apicurio/apicurio-registry-sql-native:1d' run-sql-multitenancy-integration-tests
- name: Collect logs
if: failure()
run: ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs
path: artifacts
- name: Build Native Images
env:
IMAGE_REPO: quay.io
IMAGE_TAG: 2.6.x-snapshot
ADDITIONAL_IMAGE_TAG: latest-snapshot
run: |
make build-sql-native-image
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Push Native Images
env:
IMAGE_REPO: quay.io
IMAGE_TAG: 2.6.x-snapshot
ADDITIONAL_IMAGE_TAG: latest-snapshot
if: github.event_name == 'push'
run: |
make push-sql-native-image
- name: List All The Images
run: docker images
notify-sdk:
if: github.repository_owner == 'Apicurio' && github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
runs-on: ubuntu-20.04
strategy:
matrix:
language: [go, js, python]
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: changes
with:
base: main
filters: |
openapi:
- 'app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi.json'
- name: Repository Dispatch
if: steps.changes.outputs.openapi == 'true'
uses: peter-evans/repository-dispatch@ce5485de42c9b2622d2ed064be479e8ed65e76f4
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository: Apicurio/apicurio-registry-client-sdk-${{ matrix.language }}
event-type: on-oas-updated
client-payload: '{"openapi_file_path": "app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi.json"}'
trigger-examples-build:
if: github.repository_owner == 'Apicurio' && github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
runs-on: ubuntu-20.04
needs: [build-verify]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@ce5485de42c9b2622d2ed064be479e8ed65e76f4
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository: Apicurio/apicurio-registry-examples
event-type: on-registry-updated
# Triggers apicurio-registry-mt-ui build whenever apicurio-registry/ui changes
trigger-mt-ui-build:
if: github.repository_owner == 'Apicurio' && github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
runs-on: ubuntu-20.04
needs: [build-verify]
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: changes
with:
base: main
list-files: 'csv'
filters: |
registry-ui:
- 'ui/**'
- name: Repository Dispatch
if: steps.changes.outputs.registry-ui == 'true'
uses: peter-evans/repository-dispatch@ce5485de42c9b2622d2ed064be479e8ed65e76f4
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository: Apicurio/apicurio-registry-mt-ui
event-type: on-registry-ui-update