1
- name : " e2e-workflow "
1
+ name : " E2E Workflow "
2
2
description : " Run Greenhouse E2E test against a Kubernetes cluster"
3
3
inputs :
4
4
admin-cluster-name :
@@ -9,97 +9,69 @@ inputs:
9
9
description : " The kind cluster name"
10
10
required : false
11
11
default : " greenhouse-remote"
12
- namespace :
13
- description : " The namespcace to be created in the kind cluster"
14
- required : false
15
- default : " greenhouse"
16
- kubernetes-version :
12
+ k8s-version :
17
13
description : " The Kubernetes version used to spin up clusters"
18
- required : false
19
- default : " v1.30.4"
20
- go-version :
21
- description : " The Go version to build greenhousectl"
22
- required : false
23
- default : " 1.23"
14
+ required : true
15
+ scenario :
16
+ description : " The E2E scenario to run"
17
+ required : true
18
+ outputs :
19
+ result :
20
+ description : " The path to the E2E test results"
21
+ value : ${{ steps.e2e.outputs.result }}
22
+
24
23
runs :
25
24
using : " composite"
26
25
steps :
27
- - name : Checkout tools repo
26
+
27
+ - name : Checkout repository
28
28
uses : actions/checkout@v4
29
29
with :
30
30
repository : cloudoperators/greenhouse
31
+
31
32
- name : Set up Go
32
33
uses : actions/setup-go@v5
33
34
with :
34
- go-version : ${{ inputs.go-version }}
35
- - name : Build greenhousectl
36
- shell : bash
37
- run : |
38
- make build-greenhousectl
39
- - name : Create k8s Kind Cluster
40
-
35
+ go-version-file : ' go.mod'
36
+
37
+ # Create the admin cluster with latest kubernetes version
38
+ - name : Create Admin Cluster
39
+
41
40
with :
42
- install_only : true
43
- - name : compose config.json
44
- shell : bash
45
- run : |
46
- cat << EOF > $RUNNER_TEMP/config.json
47
- {
48
- "config":[
49
- {
50
- "cluster":{
51
- "name": "${{ inputs.remote-cluster-name }}",
52
- "version": "${{ inputs.kubernetes-version }}"
53
- }
54
- },
55
- {
56
- "cluster":{
57
- "name": "${{ inputs.admin-cluster-name }}",
58
- "namespace": "${{ inputs.namespace }}",
59
- "version": "${{ inputs.kubernetes-version }}"
60
- },
61
- "dependencies":[
62
- {
63
- "manifest":{
64
- "release":"greenhouse",
65
- "chartPath":"charts/idproxy",
66
- "crdOnly":true
67
- }
68
- },
69
- {
70
- "manifest":{
71
- "release":"greenhouse",
72
- "chartPath":"charts/manager",
73
- "valuesPath":"dev-env/localenv/sample.values.yaml",
74
- "crdOnly":false,
75
- "webhook":{
76
- "devMode":false,
77
- "dockerFile":"./",
78
- "envs":[
79
- {
80
- "name":"CONTROLLERS_ONLY",
81
- "value":"true"
82
- }
83
- ]
84
- }
85
- }
86
- }
87
- ]
88
- }
89
- ]
90
- }
91
- EOF
92
- - name : run greenhousectl
93
- shell : bash
94
- run : |
95
- bin/greenhousectl dev setup -f $RUNNER_TEMP/config.json
96
- - name : export kubeconfig
41
+ cluster_name : ${{ inputs.admin-cluster-name }}
42
+ node_image : ' kindest/node:v1.31.0'
43
+
44
+ # Create the remote cluster with kubernetes version from the matrix
45
+ - name : Create Remote Cluster
46
+
47
+ with :
48
+ node_image : ' kindest/node:${{ inputs.k8s-version }}'
49
+ cluster_name : ${{ inputs.remote-cluster-name }}
50
+ config : ${{ github.workspace }}/e2e/kind-config.yaml
51
+
52
+ # build CLI, setup e2e environment and prepare kubeconfigs
53
+ - name : " Prepare E2E Config"
97
54
shell : bash
55
+ id : config
98
56
run : |
99
- kind export kubeconfig --name ${{ inputs.admin-cluster-name }} --kubeconfig $RUNNER_TEMP/e2e.kubeconfig
100
- kind export kubeconfig --internal --name ${{ inputs.admin-cluster-name }} --kubeconfig $RUNNER_TEMP/e2e.internal.kubeconfig
101
- - name : run e2e test
57
+ make setup-e2e
58
+ echo "admin_config=$GITHUB_WORKSPACE/bin/${{inputs.admin-cluster-name}}.kubeconfig" >> $GITHUB_OUTPUT
59
+ echo "remote_config=$GITHUB_WORKSPACE/bin/${{inputs.remote-cluster-name}}.kubeconfig" >> $GITHUB_OUTPUT
60
+ echo "remote_int_config=$GITHUB_WORKSPACE/bin/${{inputs.remote-cluster-name}}-int.kubeconfig" >> $GITHUB_OUTPUT
61
+
62
+ # run the e2e tests with the scenario from the matrix
63
+ - name : " E2E Run"
102
64
shell : bash
65
+ id : e2e
66
+ continue-on-error : true
67
+ env :
68
+ SCENARIO : ${{ inputs.scenario }}
69
+ EXECUTION_ENV : gh-actions
70
+ GREENHOUSE_ADMIN_KUBECONFIG : ${{ steps.config.outputs.admin_config }}
71
+ GREENHOUSE_REMOTE_KUBECONFIG : ${{ steps.config.outputs.remote_config }}
72
+ GREENHOUSE_REMOTE_INT_KUBECONFIG : ${{ steps.config.outputs.remote_int_config }}
73
+ CONTROLLER_LOGS_PATH : ${{github.workspace}}/bin/${{inputs.scenario}}-${{inputs.k8s-version}}.txt
74
+ E2E_REPORT_PATH : ${{github.workspace}}/bin/${{inputs.scenario}}-${{matrix.k8s-version}}.json
103
75
run : |
104
- sleep 30s
105
- USE_EXISTING_CLUSTER=true TEST_KUBECONFIG=$RUNNER_TEMP/ e2e.kubeconfig INTERNAL_KUBECONFIG=$RUNNER_TEMP/e2e.internal.kubeconfig go test ./test/e2e/... -coverprofile cover.out -v
76
+ echo "result=$CONTROLLER_LOGS_PATH" >> $GITHUB_OUTPUT
77
+ make e2e
0 commit comments