forked from vmware-tanzu/kubeapps
-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (122 loc) · 4.1 KB
/
gke_e2e_tests.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
# Copyright 2022 the Kubeapps contributors
# SPDX-License-Identifier: Apache-2.0
name: "GKE e2e Tests"
on:
workflow_call:
inputs:
CHARTMUSEUM_VERSION:
type: string
DEBUG_MODE:
type: boolean
required: false
default: false
DEV_MODE:
type: boolean
required: false
default: false
#TODO: right now it contains just the version number (eg. 1.22), rename to GKE_VERSION once CircleCI is decommissioned
GKE_BRANCH:
type: string
description: "The branch of the GKE environment in which we want to test."
GKE_CLUSTER:
type: string
GKE_PROJECT:
type: string
GKE_RELEASE_CHANNEL:
type: string
GKE_ZONE:
type: string
HELM_VERSION_MIN:
type: string
HELM_VERSION_STABLE:
type: string
IMG_DEV_TAG:
type: string
IMG_MODIFIER:
type: string
IMG_PREFIX:
type: string
KAPP_CONTROLLER_VERSION:
type: string
KUBECTL_VERSION:
type: string
OLM_VERSION:
type: string
TEST_TIMEOUT_MINUTES:
type: number
required: false
default: 6
TEST_LATEST_RELEASE:
type: boolean
required: false
default: false
USE_MULTICLUSTER_OIDC_ENV:
type: boolean
required: false
default: false
secrets:
GKE_ADMIN:
required: true
GCLOUD_KEY:
required: true
jobs:
e2e_tests:
runs-on: ubuntu-latest
env:
CHARTMUSEUM_VERSION: ${{ inputs.CHARTMUSEUM_VERSION }}
DEV_MODE: ${{ inputs.DEV_MODE }}
DEBUG_MODE: ${{ inputs.DEBUG_MODE }}
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
GKE_ADMIN: ${{ secrets.GKE_ADMIN }}
GKE_BRANCH: ${{ inputs.GKE_BRANCH }}
GKE_CLUSTER: ${{ inputs.GKE_CLUSTER }}
GKE_PROJECT: ${{ inputs.GKE_PROJECT }}
GKE_RELEASE_CHANNEL: ${{ inputs.GKE_RELEASE_CHANNEL }}
GKE_ZONE: ${{ inputs.GKE_ZONE }}
HELM_VERSION_MIN: ${{ inputs.HELM_VERSION_MIN }}
HELM_VERSION_STABLE: ${{ inputs.HELM_VERSION_STABLE }}
IMG_DEV_TAG: ${{ inputs.IMG_DEV_TAG }}
IMG_MODIFIER: ${{ inputs.IMG_MODIFIER }}
IMG_PREFIX: ${{ inputs.IMG_PREFIX }}
KAPP_CONTROLLER_VERSION: ${{ inputs.KAPP_CONTROLLER_VERSION }}
KUBECTL_VERSION: ${{ inputs.KUBECTL_VERSION }}
OLM_VERSION: ${{ inputs.OLM_VERSION }}
TEST_LATEST_RELEASE: ${{ inputs.TEST_LATEST_RELEASE }}
TEST_TIMEOUT_MINUTES: ${{ inputs.TEST_TIMEOUT_MINUTES }}
USE_MULTICLUSTER_OIDC_ENV: ${{ inputs.USE_MULTICLUSTER_OIDC_ENV }}
steps:
- uses: actions/checkout@v3
- run: |
set -euo pipefail
source ./script/lib/libcitools.sh
installGCloudSDK
configureGCloud "${GKE_PROJECT}" "${GCLOUD_KEY}"
installKubectl "${KUBECTL_VERSION}"
installHelm "${HELM_VERSION_MIN}"
installHelm "${HELM_VERSION_STABLE}" helm-stable
exportEscapedGKEClusterName "${GKE_CLUSTER}" "${GKE_RELEASE_CHANNEL}" "${GITHUB_REF_NAME}" "${TEST_LATEST_RELEASE}" "${DEV_MODE}"
- name: Start GKE environment
run: |
set -euo pipefail
./script/start-gke-env.sh "${ESCAPED_GKE_CLUSTER}" "${GKE_ZONE}" "${GKE_BRANCH}" "${GKE_ADMIN}" > /dev/null
- # TODO(castelblanque) Unify shared resources with kubeapps-local-dev-users-rbac.yaml that only applies to Kind clusters
name: Apply customizations to GKE cluster
run: |
kubectl create namespace kubeapps-user-namespace
./script/install-nginx.sh
- name: "Run e2e tests script"
env:
TESTS_GROUP: "all"
run: ./script/run_e2e_tests.sh
- name: 'Upload Artifacts'
if: failure()
uses: actions/upload-artifact@v3
with:
name: gke_${{ inputs.GKE_RELEASE_CHANNEL }}_e2e_tests_reports
path: integration/reports
- name: "Delete GKE cluster"
if: always()
run: |
set -euo pipefail
source ./script/lib/libcitools.sh
deleteGKECluster "${GKE_ZONE}" "${ESCAPED_GKE_CLUSTER}"