generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 27
183 lines (139 loc) · 4.79 KB
/
e2e.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
name: e2e
on: [pull_request]
env:
GO_VERSION: '1.20'
jobs:
build-operator-image:
runs-on: ubuntu-20.04
name: Build the KMMO container image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make docker-build IMG=kmm:local
- name: Export the image
run: docker save -o kmm_local.tar kmm:local
- name: Upload the image
uses: actions/upload-artifact@v3
with:
name: ci-images
if-no-files-found: error
path: kmm_local.tar
retention-days: 1
build-operator-hub-image:
runs-on: ubuntu-20.04
name: Build the KMMO-hub container image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make docker-build-hub HUB_IMG=kmm-hub:local
- name: Export the image
run: docker save -o kmm-hub_local.tar kmm-hub:local
- name: Upload the image
uses: actions/upload-artifact@v3
with:
name: ci-images
if-no-files-found: error
path: kmm-hub_local.tar
retention-days: 1
build-signing-image:
runs-on: ubuntu-20.04
name: Build the signing image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make signimage-build SIGNER_IMG=kmm-signimage:local
- name: Export the image
run: docker save -o kmm-signimage_local.tar kmm-signimage:local
- name: Upload the image
uses: actions/upload-artifact@v3
with:
name: ci-images
if-no-files-found: error
path: kmm-signimage_local.tar
retention-days: 1
build-worker-image:
runs-on: ubuntu-20.04
name: Build the worker image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make workerimage-build WORKER_IMG=kmm-worker:local
- name: Export the image
run: docker save -o kmm-worker_local.tar kmm-worker:local
- name: Upload the image
uses: actions/upload-artifact@v3
with:
name: ci-images
if-no-files-found: error
path: kmm-worker_local.tar
retention-days: 1
e2e:
strategy:
matrix:
include:
- name: e2e
env:
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci
script: ./ci/prow/e2e-incluster-build
- name: e2e-hub
env:
KUSTOMIZE_CONFIG_HUB_DEFAULT: ci/install-ci-hub
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci-spoke
import_hub_image: true
script: ./ci/prow/e2e-hub-spoke-incluster-build
runs-on: ubuntu-20.04
name: ${{ matrix.name }}
needs: [build-operator-image, build-operator-hub-image, build-signing-image, build-worker-image]
services:
registry:
image: registry:2
ports: ['5000:5000/tcp']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create the minikube cluster
uses: ./.github/actions/create-minikube-cluster
with:
start-args: --insecure-registry=host.minikube.internal:5000
- name: Download container images
uses: actions/download-artifact@v3
with:
name: ci-images
- name: Import the KMM operator image into minikube
run: minikube image load kmm_local.tar
- name: Import the KMM-hub operator image into minikube
run: minikube image load kmm-hub_local.tar
if: ${{ matrix.import_hub_image }}
- name: Copy the signing and worker images to the registry
run: |
docker load -i kmm-signimage_local.tar
docker load -i kmm-worker_local.tar
docker tag kmm-signimage:local localhost:5000/kmm/signimage:local
docker tag kmm-worker:local localhost:5000/kmm/worker:local
docker push localhost:5000/kmm/signimage:local
docker push localhost:5000/kmm/worker:local
- name: Set some Ubuntu environment variables
run: |
grep 'ID=' /etc/os-release >> "$GITHUB_ENV"
grep 'VERSION_ID=' /etc/os-release >> "$GITHUB_ENV"
- name: Cache binaries needed by Makefile
id: cache-bin
uses: actions/cache@v3
with:
path: ./bin
key: ${{ runner.os }}-${{ env.ID }}-${{ env.VERSION_ID }}-bin-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
if: steps.cache-bin.outputs.cache-hit != 'true'
- name: Run test
run: ${{ matrix.script }}
env:
${{ matrix.env }}
- name: Collect troubleshooting data
uses: ./.github/actions/collect-troubleshooting
if: ${{ always() }}