-
Notifications
You must be signed in to change notification settings - Fork 35
114 lines (99 loc) · 4.14 KB
/
__conformance_tests.yaml
File metadata and controls
114 lines (99 loc) · 4.14 KB
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: Conformance tests
on:
workflow_call: {}
permissions:
contents: read
env:
MISE_VERBOSE: 1
MISE_DEBUG: 1
jobs:
conformance-tests:
timeout-minutes: ${{ fromJSON(vars.GHA_EXTENDED_TIMEOUT_MINUTES || 60) }}
runs-on: ubuntu-latest
name: ${{ format('{0} {1}', matrix.gateway-type, matrix.router-flavor) }}
strategy:
fail-fast: false
matrix:
router-flavor:
- traditional_compatible
- expressions
gateway-type:
- standard
- hybrid
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Fetch all history so that we can get the correct commit hash for the conformance tests.
fetch-depth: 0
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: false
- uses: jdx/mise-action@c1ecc8f748cd28cdeabf76dab3cccde4ce692fe4 # v4.0.0
with:
install: false
- run: echo "GO_MOD_CACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- run: echo "GO_BUILD_CACHE=$(go env GOCACHE)" >> $GITHUB_ENV
# Share the cache key across all conformance test jobs.
- run: echo "GO_CACHE_KEY=go-conformancetests-${{ runner.os }}-${{ runner.arch }}-go-${{ hashFiles('**/go.mod') }}" >> $GITHUB_ENV
- run: echo "GO_CACHE_KEY_2=go-conformancetests-${{ runner.os }}-${{ runner.arch }}-go-" >> $GITHUB_ENV
- name: Go cache main branch
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
with:
path: |
${{ env.GO_MOD_CACHE }}
${{ env.GO_BUILD_CACHE }}
key: ${{ env.GO_CACHE_KEY }}
restore-keys: |
${{ env.GO_CACHE_KEY }}
${{ env.GO_CACHE_KEY_2 }}
- name: Go cache (restore only for non-main branches)
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7
with:
path: |
${{ env.GO_MOD_CACHE }}
${{ env.GO_BUILD_CACHE }}
key: ${{ env.GO_CACHE_KEY }}
restore-keys: |
${{ env.GO_CACHE_KEY }}
${{ env.GO_CACHE_KEY_2 }}
- name: run conformance tests
run: make test.conformance
env:
GOTESTSUM_JUNITFILE: conformance-tests-${{ matrix.router-flavor }}-${{ matrix.gateway-type }}.xml
TEST_KONG_ROUTER_FLAVOR: ${{ matrix.router-flavor }}
KONG_TEST_CONFORMANCE_GATEWAY_TYPE: ${{ matrix.gateway-type }}
KONG_TEST_KONNECT_ACCESS_TOKEN: ${{ matrix.gateway-type == 'hybrid' && secrets.KONG_TEST_KONNECT_ACCESS_TOKEN || '' }}
KONG_TEST_KONNECT_SERVER_URL: ${{ matrix.gateway-type == 'hybrid' && 'us.api.konghq.tech' || '' }}
KONG_TEST_FORCE_CLEANUP: "true"
- name: upload diagnostics
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: diagnostics-conformance-${{ matrix.router-flavor }}-${{ matrix.gateway-type }}
path: /tmp/ktf-diag*
if-no-files-found: ignore
- name: collect test report
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: tests-report-conformance-${{ matrix.router-flavor }}-${{ matrix.gateway-type }}
path: conformance-tests-${{ matrix.router-flavor }}-${{ matrix.gateway-type }}.xml
- name: collect conformance report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: conformance-report-${{ matrix.router-flavor }}-${{ matrix.gateway-type }}
path: experimental-*-report.yaml
- name: upload controller logs
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: controller-logs-${{ matrix.router-flavor }}-${{ matrix.gateway-type }}
path: /tmp/kong-operator-controller-logs*
if-no-files-found: error