-
Notifications
You must be signed in to change notification settings - Fork 592
114 lines (109 loc) · 4.65 KB
/
validate_kong_image.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
name: "validate Kong image (targeted)"
run-name: "validate Kong ${{ format('{0}:{1}', github.event.inputs.kong-image-repo, github.event.inputs.kong-image-tag) }}"
on:
workflow_dispatch:
inputs:
kong-image-repo:
description: Kong Gateway Docker image to test with (repository). Must be an EE variant.
type: string
required: true
default: "kong/kong-gateway"
kong-image-tag:
description: Kong Gateway Docker image to test with (tag).
type: string
required: true
default: "latest"
kong-effective-version:
description: Effective semantic version of Kong Gateway Docker image. If not given, the semantic version will be parsed from the image tag.
type: string
required: false
e2e-controller-image-repo:
description: KIC Docker image for E2E tests (repository).
type: string
required: true
default: "kong/kubernetes-ingress-controller"
e2e-controller-image-tag:
description: KIC Docker image for E2E tests (tag).
type: string
required: true
default: "latest"
issue-number:
description: Issue number to comment in, and close in case of success. Can be none.
type: string
required: false
jobs:
startup-issue-comment:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }}
if: ${{ github.event.inputs.issue-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 }}
ISSUE_NUMBER: ${{ github.event.inputs.issue-number }}
steps:
- uses: actions/checkout@v4
- run: |
gh issue comment ${ISSUE_NUMBER} --body \
'Kong Gateway validation tests were started at ${{ env.URL }} with the following parameters:
```json
${{ toJSON(github.event.inputs) }}
```
'
run-e2e-tests:
if: ${{ !cancelled() }}
uses: ./.github/workflows/_e2e_tests.yaml
secrets: inherit
with:
kic-image: ${{ format('{0}:{1}', github.event.inputs.e2e-controller-image-repo, github.event.inputs.e2e-controller-image-tag) }}
kong-image: ${{ format('{0}:{1}', github.event.inputs.kong-image-repo, github.event.inputs.kong-image-tag) }}
load-local-image: false
run-gke: true
run-istio: true
all-supported-k8s-versions: true
run-integration-tests:
if: ${{ !cancelled() }}
uses: ./.github/workflows/_integration_tests.yaml
secrets: inherit
with:
kong-container-repo: ${{ github.event.inputs.kong-image-repo }}
kong-container-tag: ${{ github.event.inputs.kong-image-tag }}
kong-oss-effective-version: ${{ github.event.inputs.kong-effective-version }}
# We're passing the same image twice, because the integration tests need to know the image
# for Enterprise variant of tests separately.
# That makes this workflow usable only for Enterprise images.
kong-enterprise-container-repo: ${{ github.event.inputs.kong-image-repo }}
kong-enterprise-container-tag: ${{ github.event.inputs.kong-image-tag }}
kong-enterprise-effective-version: ${{ github.event.inputs.kong-effective-version }}
log-output-file: /tmp/integration-tests-kic-logs
on-finish-comment-or-close-issue:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }}
needs:
- startup-issue-comment
- run-e2e-tests
- run-integration-tests
if: ${{ always() && github.event.inputs.issue-number != '' }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
ISSUE_NUMBER: ${{ github.event.inputs.issue-number }}
steps:
- uses: actions/checkout@v4
- if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: |
gh issue close ${ISSUE_NUMBER} --comment \
'Kong Gateway validation tests **PASSED** ✅ at ${{ env.URL }} with the following parameters:
```json
${{ toJSON(github.event.inputs) }}
```
'
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
gh issue comment ${ISSUE_NUMBER} --body \
'Kong Gateway validation tests **FAILED** ❌ at ${{ env.URL }} with the following parameters:
```json
${{ toJSON(github.event.inputs) }}
```
'