-
Notifications
You must be signed in to change notification settings - Fork 483
216 lines (186 loc) · 5.82 KB
/
release-pr.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
name: PR tests
concurrency:
# Run only for most recent commit in PRs but for all tags and commits on main
# Ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
on:
pull_request:
branches:
- main
- release/kong-2.x
- release/kong-3.x
workflow_dispatch: {}
env:
# Specify this here because these tests rely on ktf to run kind for cluster creation.
KIND_VERSION: v0.23.0
jobs:
lint:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: jdx/mise-action@v2
with:
install: false
- name: Run linters
env:
MISE_VERBOSE: 1
MISE_DEBUG: 1
run: make lint
lint-test:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
kubernetes-version:
# renovate: datasource=docker depName=kindest/node
- "1.31.4"
chart-name:
- kong
- ingress
- gateway-operator
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
- name: Add Helm repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add kong https://charts.konghq.com
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: ct lint --target-branch main --check-version-increment=false
- name: setup testing environment (kind-cluster)
env:
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
CHART_NAME: ${{ matrix.chart-name }}
run: ./scripts/test-env.sh
- name: Run chart-testing (install)
run: |
kubectl create ns kong-test
ct install --target-branch main --charts charts/${{ matrix.chart-name}} --namespace kong-test
# No need to delete the ns the cluster is scrapped after the job anyway.
integration-test:
timeout-minutes: 30
runs-on: ubuntu-latest
env:
GATEWAY_API_VERSION: v1.0.0
strategy:
matrix:
kubernetes-version:
# renovate: datasource=docker depName=kindest/node
- "1.26.15"
# renovate: datasource=docker depName=kindest/node
- "1.27.16"
# renovate: datasource=docker depName=kindest/node
- "1.28.15"
# renovate: datasource=docker depName=kindest/node
- "1.29.12"
# renovate: datasource=docker depName=kindest/node
- "1.30.8"
# renovate: datasource=docker depName=kindest/node
- "1.31.4"
chart-name:
- kong
- ingress
- gateway-operator
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup helm
uses: azure/[email protected]
- name: setup testing environment (kind-cluster)
env:
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
CHART_NAME: ${{ matrix.chart-name }}
run: ./scripts/test-env.sh
- name: run integration tests (integration)
env:
CHART_NAME: ${{ matrix.chart-name }}
run: ./scripts/test-run.sh
- name: run upgrade integration tests (integration-upgrade)
env:
CHART_NAME: ${{ matrix.chart-name }}
run: ./scripts/test-upgrade.sh
- name: cleanup integration tests (cleanup)
run: ./scripts/test-env.sh cleanup
oldversion-integration-test:
timeout-minutes: 30
runs-on: ubuntu-latest
env:
GATEWAY_API_VERSION: v0.8.1
strategy:
matrix:
kic-version:
- "2.10"
- "2.11"
kong-version:
- "3.3"
- "3.2"
chart-name:
- kong
- ingress
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup helm
uses: azure/[email protected]
- name: setup testing environment (kind-cluster)
env:
KUBERNETES_VERSION: "1.29.2"
CHART_NAME: ${{ matrix.chart-name }}
run: ./scripts/test-env.sh
- name: run integration tests (integration)
env:
CHART_NAME: ${{ matrix.chart-name }}
KONG_VERSION: ${{ matrix.kong-version }}
KIC_VERSION: ${{ matrix.kic-version }}
run: ./scripts/test-run.sh
- name: cleanup integration tests (cleanup)
run: ./scripts/test-env.sh cleanup
golden-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
name: golden-tests
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup helm
uses: azure/[email protected]
- uses: jdx/mise-action@v2
with:
install: false
- name: build helm chart dependency
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add kong https://charts.konghq.com
helm dependency build charts/kong
helm dependency build charts/ingress
- name: run golden tests
run: make test.golden
# Workaround to allow checking the matrix tests as required tests without adding the individual cases
# Ref: https://github.com/orgs/community/discussions/26822#discussioncomment-3305794
passed:
timeout-minutes: 30
runs-on: ubuntu-latest
needs:
- lint
- lint-test
- integration-test
- oldversion-integration-test
- golden-tests
if: always()
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
echo "Some jobs failed or were cancelled."
exit 1