22
22
23
23
jobs :
24
24
kubectl_tests :
25
- # FIXME: do not sneaky build the operator. Use a built one
26
25
name : kubectl rabbitmq tests
27
26
runs-on : ubuntu-latest
28
27
needs :
@@ -70,19 +69,21 @@ jobs:
70
69
kubectl kustomize config/crd | kubectl apply -f-
71
70
kubectl kustomize config/default/base | ytt -f- \
72
71
-f config/ytt/overlay-manager-image.yaml \
73
- --data-value operator-image ="$IMG" \
72
+ --data-value operator_image ="${ IMG} " \
74
73
-f config/ytt/never_pull.yaml \
75
74
| kubectl apply -f-
76
75
77
76
make kubectl-plugin-tests
78
77
79
- # - name: Notify Google Chat
78
+ - name : Notify Google Chat
79
+ # TODO: add back before PR
80
+ if : false
80
81
# if: ${{ failure() && github.event_name != 'pull_request' }}
81
- # uses: SimonScholz/google-chat-action@main
82
- # with:
83
- # webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}'
84
- # jobStatus: ${{ job.status }}
85
- # title: Cluster Operator - RabbitMQ kubectl tests
82
+ uses : SimonScholz/google-chat-action@main
83
+ with :
84
+ webhookUrl : ' ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}'
85
+ jobStatus : ${{ job.status }}
86
+ title : Cluster Operator - RabbitMQ kubectl tests
86
87
87
88
unit_integration_tests :
88
89
name : unit and integration tests
@@ -278,15 +279,12 @@ jobs:
278
279
id : single-arch-meta-amd64
279
280
uses : docker/metadata-action@v5
280
281
with :
281
- # list of Docker images to use as base name for tags
282
282
images : |
283
283
rabbitmqoperator/cluster-operator
284
284
flavor : |
285
285
latest=false
286
- # generate Docker tags based on the following events/attributes
287
286
tags : |
288
287
type=semver,pattern={{version}},suffix=-amd64,latest=false
289
- type=sha,suffix=-amd64,latest=false
290
288
291
289
- name : Build and push single-arch amd64 image
292
290
uses : docker/build-push-action@v6
@@ -333,10 +331,9 @@ jobs:
333
331
tags : ${{ steps.single-arch-meta-arm64.outputs.tags }}
334
332
labels : ${{ steps.single-arch-meta-arm64.outputs.labels }}
335
333
336
- system_tests_local :
334
+ system_tests :
337
335
name : Local system tests (stable k8s)
338
336
runs-on : ubuntu-latest
339
- if : ${{ github.event_name == 'pull_request' }}
340
337
needs : build_operator
341
338
strategy :
342
339
matrix :
@@ -354,16 +351,43 @@ jobs:
354
351
- name : Check out code into the Go module directory
355
352
uses : actions/checkout@v4
356
353
354
+ - name : Create KinD
355
+ uses : helm/kind-action@v1
356
+ with :
357
+ cluster_name : system-testing
358
+ node_image : ${{ env.KIND_NODE_IMAGE }}
359
+
360
+ - name : Download Operator manifest
361
+ uses : actions/download-artifact@v4
362
+ # This manifest was generated by the build_operator job, and it has the image tag for this specific execution.
363
+ # Thanks to that, we don't have to make YAML modifications to deploy the right image.
364
+ with :
365
+ name : operator-manifests
366
+ path : tmp/
367
+
368
+ - name : Download Operator artifact
369
+ uses : actions/download-artifact@v4
370
+ with :
371
+ name : operator_image
372
+ path : /tmp
373
+
374
+ - name : carvel-setup-action
375
+ uses :
carvel-dev/[email protected]
376
+ with :
377
+ only : ytt
378
+
379
+ - name : Install Operator build
380
+ run : |
381
+ kind load image-archive /tmp/operator.tar --name system-testing
382
+ ytt -f tmp/cluster-operator.yml -f config/ytt/never_pull.yaml | kubectl apply -f-
383
+ kubectl --namespace=rabbitmq-system wait --for=condition=Available deployment/rabbitmq-cluster-operator
384
+
357
385
- name : System tests
358
386
env :
359
387
KIND_NODE_IMAGE : ${{ env.KIND_NODE_IMAGE }}
360
388
RABBITMQ_IMAGE : ${{ matrix.rabbitmq-image }}
361
389
# make deploy-kind builds the image locally
362
- # TODO: we can build the image locally in Actions
363
390
run : |
364
- make install-tools
365
- kind create cluster --image "$KIND_NODE_IMAGE"
366
- DOCKER_REGISTRY_SERVER=local-server OPERATOR_IMAGE=local-operator make deploy-kind
367
391
make cert-manager
368
392
SUPPORT_VOLUME_EXPANSION=false make system-tests
369
393
@@ -379,7 +403,6 @@ jobs:
379
403
system_tests_oldest_k8s :
380
404
name : Local system tests (min k8s)
381
405
runs-on : ubuntu-latest
382
- if : ${{ github.event_name == 'pull_request' }}
383
406
needs : build_operator
384
407
strategy :
385
408
matrix :
@@ -396,106 +419,52 @@ jobs:
396
419
- name : Check out code into the Go module directory
397
420
uses : actions/checkout@v4
398
421
399
- - name : System tests
400
- env :
401
- KIND_NODE_IMAGE : ${{ env.KIND_OLDEST_NODE_IMAGE }}
402
- RABBITMQ_IMAGE : ${{ matrix.rabbitmq-image }}
403
- run : |
404
- make install-tools
405
- kind create cluster --image "$KIND_NODE_IMAGE"
406
- DOCKER_REGISTRY_SERVER=local-server OPERATOR_IMAGE=local-operator make deploy-kind
407
- make cert-manager
408
- SUPPORT_VOLUME_EXPANSION=false make system-tests
409
-
410
- system_tests :
411
- name : System tests
412
- runs-on : ubuntu-latest
413
- if : ${{ github.event_name != 'pull_request' }}
414
- permissions :
415
- # Required by ben-z/[email protected]
416
- contents : ' write'
417
- # Required by google-github-actions/auth@v2
418
- # Required by google-github-actions/get-gke-credentials@v2
419
- id-token : ' write'
420
- needs : build_operator
421
- strategy :
422
- matrix :
423
- rabbitmq-image :
424
- - rabbitmq:3.11.0-management
425
- - rabbitmq:management
426
- - pivotalrabbitmq/rabbitmq:main
427
- include :
428
- - rabbitmq-image : rabbitmq:3.11.0-management
429
- gke-cluster : ci-bunny-1
430
- - rabbitmq-image : rabbitmq:management
431
- gke-cluster : ci-bunny-1
432
- - rabbitmq-image : pivotalrabbitmq/rabbitmq:main
433
- gke-cluster : ci-bunny-2
434
- steps :
435
- - name : Install Go
436
- uses : actions/setup-go@v5
437
- with :
438
- go-version : ${{ env.GO_VERSION }}
439
- check-latest : true
440
-
441
- - name : Check out code into the Go module directory
442
- uses : actions/checkout@v4
443
-
444
- - name : Acquire lock for ${{ matrix.gke-cluster }}
445
-
422
+ - name : Create KinD
423
+ uses : helm/kind-action@v1
446
424
with :
447
- branch : lock-${{ matrix.gke-cluster }}
425
+ cluster_name : system-testing-oldest-k8s
426
+ node_image : ${{ env.KIND_OLDEST_NODE_IMAGE }}
448
427
449
- - id : auth
450
- name : Authenticate with GCP
451
- uses : google-github-actions/auth@v2
452
- with :
453
- workload_identity_provider : ${{ secrets.GCP_IDENTITY_PROVIDER }}
454
- service_account : ${{ secrets.GCP_SA }}
455
-
456
- - id : get-credentials
457
- name : Fetch creds
458
- uses : google-github-actions/get-gke-credentials@v2
428
+ - name : Download Operator artifact
429
+ uses : actions/download-artifact@v4
459
430
with :
460
- cluster_name : ${{ matrix.gke-cluster }}
461
- location : europe-west1
431
+ name : operator_image
432
+ path : /tmp
462
433
463
- - name : Get operator manifest
434
+ - name : Download Operator manifest
464
435
uses : actions/download-artifact@v4
436
+ # This manifest was generated by the build_operator job, and it has the image tag for this specific execution.
437
+ # Thanks to that, we don't have to make YAML modifications to deploy the right image.
465
438
with :
466
439
name : operator-manifests
440
+ path : tmp/
441
+
442
+ - name : carvel-setup-action
443
+ uses :
carvel-dev/[email protected]
444
+ with :
445
+ only : ytt
467
446
468
447
- name : Install Operator build
469
448
run : |
470
- make destroy
471
- kubectl apply -f cluster-operator.yml
449
+ kind load image-archive /tmp/operator.tar --name system-testing-oldest-k8s
450
+ ytt -f tmp/ cluster-operator.yml -f config/ytt/never_pull.yaml | kubectl apply -f-
472
451
kubectl --namespace=rabbitmq-system wait --for=condition=Available deployment/rabbitmq-cluster-operator
473
452
474
- - name : Setup Ginkgo
475
- uses : ci-tasks/setup-ginkgo@main
476
-
477
453
- name : System tests
478
454
env :
455
+ KIND_NODE_IMAGE : ${{ env.KIND_OLDEST_NODE_IMAGE }}
479
456
RABBITMQ_IMAGE : ${{ matrix.rabbitmq-image }}
457
+ # make system-tests will install required tools e.g. ginkgo
480
458
run : |
481
- make system-tests
482
-
483
- - name : Notify Google Chat
484
- if : failure()
485
- uses : SimonScholz/google-chat-action@main
486
- with :
487
- webhookUrl : ' ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}'
488
- jobStatus : ${{ job.status }}
489
- title : Cluster Operator - System tests
459
+ make cert-manager
460
+ SUPPORT_VOLUME_EXPANSION=false make system-tests
490
461
491
462
test_doc_examples :
492
463
name : Documented example tests
493
464
runs-on : ubuntu-latest
494
465
if : ${{ github.event_name != 'pull_request' }}
495
466
needs : build_operator
496
467
permissions :
497
- # Required by ben-z/[email protected]
498
- contents : ' write'
499
468
# Required by google-github-actions/auth@v2
500
469
# Required by google-github-actions/get-gke-credentials@v2
501
470
id-token : ' write'
@@ -509,34 +478,36 @@ jobs:
509
478
- name : Check out code into the Go module directory
510
479
uses : actions/checkout@v4
511
480
512
- - name : Acquire lock for ci-bunny-2
513
-
481
+ - name : Download Operator artifact
482
+ uses : actions/download-artifact@v4
514
483
with :
515
- branch : lock-ci-bunny-2
484
+ name : operator_image
485
+ path : /tmp
516
486
517
- - id : auth
518
- name : Authenticate with GCP
519
- uses : google-github-actions/auth@v2
487
+ - name : Download Operator manifest
488
+ uses : actions/download-artifact@v4
489
+ # This manifest was generated by the build_operator job, and it has the image tag for this specific execution.
490
+ # Thanks to that, we don't have to make YAML modifications to deploy the right image.
520
491
with :
521
- workload_identity_provider : ${{ secrets.GCP_IDENTITY_PROVIDER }}
522
- service_account : ${{ secrets.GCP_SA }}
492
+ name : operator-manifests
493
+ path : tmp/
523
494
524
- - id : get-credentials
525
- name : Fetch creds
526
- uses : google-github-actions/get-gke-credentials@v2
495
+ - name : Create KinD
496
+ uses : helm/kind-action@v1
527
497
with :
528
- cluster_name : ci-bunny-2
529
- location : europe-west1
498
+ cluster_name : examples-testing
499
+ node_image : ${{ env.KIND_NODE_IMAGE }}
530
500
531
- - name : Get operator manifest
532
- uses : actions/download-artifact@v4
501
+ - name : carvel-setup-action
502
+ uses :
carvel-dev/[email protected]
533
503
with :
534
- name : operator-manifests
504
+ only : ytt
535
505
536
506
- name : Install Operator build
537
507
run : |
538
508
make destroy
539
- kubectl apply -f cluster-operator.yml
509
+ kind load image-archive /tmp/operator.tar --name examples-testing
510
+ ytt -f tmp/cluster-operator.yml -f config/ytt/never_pull.yaml | kubectl apply -f-
540
511
kubectl --namespace=rabbitmq-system wait --for=condition=Available deployment/rabbitmq-cluster-operator
541
512
542
513
- name : Documented example tests
@@ -553,7 +524,9 @@ jobs:
553
524
test_upgrade :
554
525
name : Test upgrade of the operator
555
526
runs-on : ubuntu-latest
556
- if : ${{ github.event_name != 'pull_request' }}
527
+ # FIXME: enable this before PR
528
+ if : false
529
+ # if: ${{ github.event_name != 'pull_request' }}
557
530
needs : build_operator
558
531
permissions :
559
532
# Required by ben-z/[email protected]
@@ -632,7 +605,7 @@ jobs:
632
605
with :
633
606
name : release-header
634
607
- name : Release
635
- uses : softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
608
+ uses : softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
636
609
if : startsWith(github.ref, 'refs/tags/')
637
610
with :
638
611
files : |
0 commit comments