forked from kyma-project/eventing-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (160 loc) · 5.87 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
name: e2e
env:
KYMA_STABILITY: "unstable"
KYMA: "./hack/kyma"
on:
push:
branches:
- main
- "release-**"
paths-ignore:
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
pull_request:
branches:
- main
- "release-**"
paths-ignore:
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
jobs:
wait-until-build-succeeds:
runs-on: ubuntu-latest
outputs:
image-name: ${{ steps.extract-image.outputs.image_name }}
steps:
- uses: actions/checkout@v4
- name: Wait for the 'pull-eventing-manager-build' job to succeed
id: pull-wait-build
if: github.event_name == 'pull_request'
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20
with:
context: "pull-eventing-manager-build"
commit_ref: "${{ github.event.pull_request.head.sha }}" # Note: 'github.event.pull_request.head.sha' is not same as 'github.sha' on pull requests.
timeout: 600000 # 10 minutes in milliseconds
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting)
check_interval: 60000 # 1 minute in milliseconds
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_OWNER: "${{ github.repository_owner }}"
GITHUB_REPO: "eventing-manager"
- name: Wait for the 'post-eventing-manager-build' job to succeed
id: push-wait-build
if: github.event_name == 'push'
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20
with:
context: "post-eventing-manager-build"
commit_ref: "${{ github.sha }}"
timeout: 600000 # 10 minutes in milliseconds
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting)
check_interval: 60000 # 1 minute in milliseconds
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_OWNER: "${{ github.repository_owner }}"
GITHUB_REPO: "eventing-manager"
- name: Extract container image name from build logs (pull)
id: extract-image
env:
# Refernce: https://docs.github.com/en/actions/learn-github-actions/expressions#example
COMMIT_STATUS_JSON: "${{ github.event_name == 'push' && steps.push-wait-build.outputs.json || steps.pull-wait-build.outputs.json }}"
run: |
./scripts/extract_image_from_build_logs.sh
# export value to job output
export IMAGE_NAME="$(cat image.name)"
echo "IMAGE_NAME: ${IMAGE_NAME}"
echo "image_name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
nats:
runs-on: ubuntu-latest
needs: wait-until-build-succeeds
env:
MANAGER_IMAGE: ${{ needs.wait-until-build-succeeds.outputs.image-name }}
steps:
- uses: actions/checkout@v4
- name: Cache Binaries
id: cache-binaries
uses: actions/cache@v4
with:
path: bin
key: ${{ runner.os }}-bin
- 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: wait-until-build-succeeds
env:
MANAGER_IMAGE: ${{ needs.wait-until-build-succeeds.outputs.image-name }}
steps:
- uses: actions/checkout@v4
- 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: wait-until-build-succeeds
if: github.event_name == 'push'
uses: "./.github/workflows/e2e-backend-switching-reuseable.yml"
with:
eventing-manager-image: ${{ needs.wait-until-build-succeeds.outputs.image-name }}
cluster-name-prefix: "ghem-"
secrets: inherit