-
Notifications
You must be signed in to change notification settings - Fork 592
199 lines (169 loc) · 6.72 KB
/
test_nightly.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
name: tests-nightly
run-name: |
e2e tests (targeted), branch:${{ github.ref_name }},
triggered by @${{ github.actor }}
concurrency:
# Limit the concurrency of tests in this workflow to run only 1 workflow for ref (branch).
# Ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types:
- labeled
workflow_dispatch: {}
env:
kong-gateway-enterprise-registry: kong/kong-gateway-dev
kong-gateway-enterprise-tag: latest
kong-gateway-enterprise-effective-version: "3.4.1"
kong-gateway-oss-registry: kong/kong
kong-gateway-oss-tag: latest-ubuntu
kong-gateway-oss-effective-version: "3.4.1"
jobs:
post-comment-in-pr:
if: (contains(github.event.*.labels.*.name, 'ci/run-nightly') || github.event_name == 'workflow_dispatch') && github.event.pull_request.number != ''
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
# URL is the current workflow's run URL.
# Sadly this is not readily available in github's context.
URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- uses: actions/checkout@v4
- run: |
MSG="Integration (targeted) tests with KIND-based cluster and latest images were started at ${URL}"
gh pr comment ${PR_NUMBER} --body "${MSG}"
# Remove the 'ci/run-nightly' label from the PR to prevent the `test_nightly.yaml`
# workflow from running again.
gh pr edit ${PR_NUMBER} --remove-label ci/run-nightly
integration-tests-enterprise-postgres-nightly:
if: contains(github.event.*.labels.*.name, 'ci/run-nightly') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: Kong/kong-license@master
id: license
with:
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: checkout repository
uses: actions/checkout@v4
- name: setup golang
uses: actions/setup-go@v5
with:
go-version: '^1.20'
- name: run integration tests
run: make test.integration.enterprise.postgres
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KONG_LICENSE_DATA: ${{ steps.license.outputs.license }}
TEST_KONG_IMAGE: ${{ env.kong-gateway-enterprise-registry }}
TEST_KONG_TAG: ${{ env.kong-gateway-enterprise-tag }}
TEST_KONG_EFFECTIVE_VERSION: ${{ env.kong-gateway-enterprise-effective-version }}
TEST_KONG_PULL_USERNAME: ${{ secrets.GHA_DOCKERHUB_PULL_USER }}
TEST_KONG_PULL_PASSWORD: ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUBLIC_TOKEN }}
- name: collect test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration-tests-enterprise-postgres-nightly
path: coverage.enterprisepostgres.out
- name: upload diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: diagnostics-integration-tests-enterprise-postgres-nightly
path: /tmp/ktf-diag*
if-no-files-found: ignore
integration-tests-enterprise-dbless-nightly:
if: contains(github.event.*.labels.*.name, 'ci/run-nightly') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: Kong/kong-license@master
id: license
with:
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: checkout repository
uses: actions/checkout@v4
- name: setup golang
uses: actions/setup-go@v5
with:
go-version: '^1.20'
- name: run integration tests
run: make test.integration.enterprise.dbless
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KONG_LICENSE_DATA: ${{ steps.license.outputs.license }}
TEST_KONG_IMAGE: ${{ env.kong-gateway-enterprise-registry }}
TEST_KONG_TAG: ${{ env.kong-gateway-enterprise-tag }}
TEST_KONG_EFFECTIVE_VERSION: ${{ env.kong-gateway-enterprise-effective-version }}
TEST_KONG_PULL_USERNAME: ${{ secrets.GHA_DOCKERHUB_PULL_USER }}
TEST_KONG_PULL_PASSWORD: ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUBLIC_TOKEN }}
- name: collect test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration-tests-enterprise-dbless-nightly
path: coverage.enterprisedbless.out
- name: upload diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: diagnostics-integration-tests-enterprise-dbless-nightly
path: /tmp/ktf-diag*
if-no-files-found: ignore
integration-tests-postgres-nightly:
if: contains(github.event.*.labels.*.name, 'ci/run-nightly') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup golang
uses: actions/setup-go@v5
with:
go-version: '^1.20'
- name: run integration tests
run: make test.integration.postgres
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_KONG_IMAGE: ${{ env.kong-gateway-oss-registry }}
TEST_KONG_TAG: ${{ env.kong-gateway-oss-tag }}
TEST_KONG_EFFECTIVE_VERSION: ${{ env.kong-gateway-oss-effective-version }}
- name: collect test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration-tests-postgres-nightly
path: coverage.postgres.out
- name: upload diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: diagnostics-integration-tests-postgres-nightly
path: /tmp/ktf-diag*
if-no-files-found: ignore
integration-tests-dbless-nightly:
if: contains(github.event.*.labels.*.name, 'ci/run-nightly') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup golang
uses: actions/setup-go@v5
with:
go-version: '^1.20'
- name: run integration tests
run: make test.integration.dbless
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_KONG_IMAGE: ${{ env.kong-gateway-oss-registry }}
TEST_KONG_TAG: ${{ env.kong-gateway-oss-tag }}
TEST_KONG_EFFECTIVE_VERSION: ${{ env.kong-gateway-oss-effective-version }}
- name: collect test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration-tests-dbless-nightly
path: coverage.dbless.out
- name: upload diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: diagnostics-integration-tests-dbless-nightly
path: /tmp/ktf-diag*
if-no-files-found: ignore