@@ -25,31 +25,64 @@ jobs:
25
25
# FIXME: do not sneaky build the operator. Use a built one
26
26
name : kubectl rabbitmq tests
27
27
runs-on : ubuntu-latest
28
+ needs :
29
+ - build_operator
28
30
steps :
29
31
- name : Install Go
30
32
uses : actions/setup-go@v5
31
33
with :
32
34
go-version : ${{ env.GO_VERSION }}
33
35
check-latest : true
36
+
37
+ - name : Check out code into the Go module directory
38
+ uses : actions/checkout@v4
39
+
40
+ - name : carvel-setup-action
41
+ uses :
carvel-dev/[email protected]
42
+ with :
43
+ only : ytt
44
+
34
45
- name : Install Bats
35
46
run : |
36
47
git clone https://github.com/bats-core/bats-core.git "$HOME"/bats-core
37
48
cd "$HOME"/bats-core
38
49
sudo ./install.sh /usr/local
39
- - name : Check out code into the Go module directory
40
- uses : actions/checkout@v4
50
+
51
+ - name : Download Operator artifact
52
+ uses : actions/download-artifact@v4
53
+ with :
54
+ name : operator_image
55
+ path : /tmp
56
+
57
+ - name : Create KinD
58
+ uses : helm/kind-action@v1
59
+ with :
60
+ cluster_name : cluster-operator-testing
61
+ node_image : ${{ env.KIND_NODE_IMAGE }}
62
+
41
63
- name : kubectl rabbitmq tests
64
+ env :
65
+ IMG : " rabbitmqoperator/cluster-operator:${{ needs.build_operator.outputs.image_sha }}"
42
66
run : |
43
- make install-tools
44
- kind create cluster --image "${{ env.KIND_NODE_IMAGE }}"
45
- DOCKER_REGISTRY_SERVER=local-server OPERATOR_IMAGE=local-operator make deploy-kind kubectl-plugin-tests
46
- - name : Notify Google Chat
47
- if : ${{ failure() && github.event_name != 'pull_request' }}
48
- uses : SimonScholz/google-chat-action@main
49
- with :
50
- webhookUrl : ' ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}'
51
- jobStatus : ${{ job.status }}
52
- title : Cluster Operator - RabbitMQ kubectl tests
67
+ kind load image-archive /tmp/operator.tar --name cluster-operator-testing
68
+
69
+ make manifests deploy-namespace-rbac
70
+ kubectl kustomize config/crd | kubectl apply -f-
71
+ kubectl kustomize config/default/base | ytt -f- \
72
+ -f config/ytt/overlay-manager-image.yaml \
73
+ --data-value operator-image="$IMG" \
74
+ -f config/ytt/never_pull.yaml \
75
+ | kubectl apply -f-
76
+
77
+ make kubectl-plugin-tests
78
+
79
+ # - name: Notify Google Chat
80
+ # 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
53
86
54
87
unit_integration_tests :
55
88
name : unit and integration tests
81
114
build_operator :
82
115
runs-on : ubuntu-latest
83
116
needs : unit_integration_tests
117
+ outputs :
118
+ image_sha : ${{ steps.build.outputs.digest }}
84
119
permissions :
85
120
contents : ' write'
86
121
id-token : ' write'
@@ -130,6 +165,7 @@ jobs:
130
165
password : ${{ secrets.QUAY_ROBOT_TOKEN }}
131
166
132
167
- name : Build and push
168
+ id : build
133
169
uses : docker/build-push-action@v6
134
170
with :
135
171
context : .
@@ -138,6 +174,14 @@ jobs:
138
174
push : ${{ github.event_name != 'pull_request' }}
139
175
tags : ${{ steps.meta.outputs.tags }}
140
176
labels : ${{ steps.meta.outputs.labels }}
177
+ outputs : |
178
+ type=docker,dest=./operator.tar
179
+
180
+ - name : Upload Operator artifact
181
+ uses : actions/upload-artifact@v4
182
+ with :
183
+ name : operator_image
184
+ path : ./operator.tar
141
185
142
186
- name : Build manifest
143
187
if : github.event_name != 'pull_request'
0 commit comments