generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 16
201 lines (169 loc) · 5.3 KB
/
e2e.yml
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
name: e2e
env:
KYMA_STABILITY: "unstable"
KYMA: "./hack/kyma"
on:
push:
branches:
- main
- "release-**"
paths-ignore:
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
- CODEOWNERS
- LICENSE
- LICENSES
- OWNERS
- OWNERS_ALIASES
- PROJECT
pull_request:
branches:
- main
- "release-**"
paths-ignore:
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
- CODEOWNERS
- LICENSE
- LICENSES
- OWNERS
- OWNERS_ALIASES
- PROJECT
jobs:
export-info:
runs-on: ubuntu-latest
outputs:
image-name: ${{ steps.extract-image.outputs.image_name }}
git-ref: ${{ steps.extract-image.outputs.git_ref }}
steps:
- name: export correct info based on event (PR or Push)
id: extract-image
env:
GIT_EVENT_NAME: "${{ github.event_name }}"
PR_NUMBER: "${{ github.event.number }}"
PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
HEAD_SHA: "${{ github.sha }}"
run: |
if [[ $GIT_EVENT_NAME == "pull_request" ]]
then
echo "exporting info for pull request..."
echo "image_name=europe-docker.pkg.dev/kyma-project/dev/eventing-manager:PR-${PR_NUMBER}" >> "$GITHUB_OUTPUT"
echo "git_ref=${PR_HEAD_SHA}" >> "$GITHUB_OUTPUT"
else
echo "exporting info for push..."
echo "image_name=europe-docker.pkg.dev/kyma-project/prod/eventing-manager:${HEAD_SHA}" >> "$GITHUB_OUTPUT"
echo "git_ref=${HEAD_SHA}" >> "$GITHUB_OUTPUT"
fi
- name: Print info
env:
IMAGE_NAME: ${{ steps.extract-image.outputs.image_name }}
GIT_REF: ${{ steps.extract-image.outputs.git_ref }}
run: |
echo "IMAGE: $IMAGE_NAME"
echo "Git ref: $GIT_REF"
wait-until-build-succeeds:
needs: export-info
uses: "kyma-project/eventing-tools/.github/workflows/wait-build-reusable.yml@main"
with:
repository: ${{ github.repository_owner }}/eventing-manager
git_ref: ${{ needs.export-info.outputs.git-ref }}
git_check_run_name: "build / Build image"
nats:
runs-on: ubuntu-latest
needs: [export-info, wait-until-build-succeeds]
env:
MANAGER_IMAGE: ${{ needs.export-info.outputs.image-name }}
steps:
- uses: actions/checkout@v4
- name: Setup Go via go.mod
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go version
- name: Install k3d tools
run: |
make -C hack/ci/ install-k3d-tools
- name: Install Kyma CLI & setup k3d cluster using kyma CLI
run: |
make kyma
make -C hack/ci/ create-k3d
kubectl version
kubectl cluster-info
- name: Install eventing-manager
run: |
make install IMG=$MANAGER_IMAGE
- name: Deploy the controller to the cluster
run: |
kubectl create ns kyma-system || true
make deploy IMG=$MANAGER_IMAGE
- name: Setup NATS
run: |
make -C hack/ci/ install-nats-module
- name: Setup and test the eventing-manager
run: |
make e2e-setup
- name: Setup eventing
run: |
make e2e-eventing-setup
- name: Test eventing
run: |
make e2e-eventing
- name: Test eventing cleanup
run: |
make e2e-cleanup
- name: On error get NATS CR
if: failure()
run: |
kubectl get nats -n kyma-system -o yaml
- name: On error get eventing CR
if: failure()
run: |
kubectl get eventing -n kyma-system -o yaml
PeerAuthentication:
runs-on: ubuntu-latest
needs: [export-info, wait-until-build-succeeds]
env:
MANAGER_IMAGE: ${{ needs.export-info.outputs.image-name }}
steps:
- uses: actions/checkout@v4
- name: Setup Go via go.mod
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go version
- name: Install k3d tools
run: |
make -C hack/ci/ install-k3d-tools
- name: Install Kyma CLI & setup k3d cluster using kyma CLI
run: |
make kyma
make -C hack/ci/ create-k3d
kubectl version
kubectl cluster-info
- name: Install PeerAuthentication CRD
run: |
make -C hack/ci/ apply-peerauthentication-crd
- name: Install eventing-manager
run: |
make install IMG=$MANAGER_IMAGE
- name: Deploy the controller to the cluster
run: |
kubectl create ns kyma-system || true
make deploy IMG=$MANAGER_IMAGE
- name: Test if the PeerAuthentications are created correctly
run: |
make e2e-eventing-peerauthentications
- name: On error get all PeerAuthentications
if: failure()
run: |
kubectl get peerauthentications.security.istio.io -A -o yaml
backend-switching:
needs: [export-info, wait-until-build-succeeds]
if: github.event_name == 'push'
uses: "./.github/workflows/e2e-backend-switching-reuseable.yml"
with:
eventing-manager-image: ${{ needs.export-info.outputs.image-name }}
cluster-name-prefix: "ghem-"
secrets: inherit