-
Notifications
You must be signed in to change notification settings - Fork 483
175 lines (151 loc) · 4.5 KB
/
main-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
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
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: third_party/go.mod
- name: Run linters
run: make lint
lint-test:
runs-on: ubuntu-latest
env:
# Specify this here because these tests rely on ktf to run kind for cluster creation.
KIND_VERSION: v0.20.0
strategy:
matrix:
chart-name:
- kong
- ingress
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.0
- 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@v4
with:
python-version: "3.11"
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false
- name: setup testing environment (kind-cluster)
env:
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
run: ./scripts/test-env.sh
- name: Run chart-testing (install)
run: ct install --charts charts/${{ matrix.chart-name}}
integration-test:
runs-on: ubuntu-latest
env:
# Specify this here because these tests rely on ktf to run kind for cluster creation.
KIND_VERSION: v0.20.0
GATEWAY_API_VERSION: v0.8.1
strategy:
matrix:
kubernetes-version:
- "1.23.13"
- "1.24.7"
- "1.25.9"
- "1.26.4"
- "1.27.1"
chart-name:
- kong
- ingress
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup helm
uses: azure/setup-helm@v3
with:
version: v3.11.0
- name: setup testing environment (kind-cluster)
env:
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
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:
runs-on: ubuntu-latest
env:
# Specify this here because these tests rely on ktf to run kind for cluster creation.
KIND_VERSION: v0.20.0
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
with:
fetch-depth: 0
- name: setup helm
uses: azure/setup-helm@v3
with:
version: v3.11.0
- name: setup testing environment (kind-cluster)
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
# 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:
runs-on: ubuntu-latest
needs:
- lint
- lint-test
- integration-test
- oldversion-integration-test
if: always()
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
echo "Some jobs failed or were cancelled."
exit 1