-
Notifications
You must be signed in to change notification settings - Fork 8
264 lines (257 loc) · 9.62 KB
/
e2e-tests.yml
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#
# Copyright (c) 2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at:
#
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#
name: JKube E2E Tests
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 1 * * *' # Every day at 1
permissions:
contents: read
jobs:
build-jkube:
name: Build JKube
uses: ./.github/workflows/build-jkube.yml
with:
run-id: ${{ github.run_id }}
minikube:
name: K8S
needs: build-jkube
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kubernetes: [v1.25.13,v1.28.1]
suite: ['quarkus','quarkus-native','springboot','webapp','other','dockerfile']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Java 11
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: '11'
distribution: 'temurin'
- name: Cache configuration
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.m2/repository
./jkube
key: cache-it-${{ github.run_id }}
- name: Setup Minikube-Kubernetes
uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d
with:
minikube version: v1.31.2
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}
start args: --force
- name: Harden Runner
uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
auth.docker.io:443
azure.archive.ubuntu.com:80
cdn03.quay.io:443
downloads.gradle.org:443
gcr.io:443
github.com:443
jcenter.bintray.com:443
k8s.gcr.io:443
maven.repository.redhat.com:443
md-hdd-51w5snc21ccf.z49.blob.storage.azure.net:443
md-hdd-bfh3mwcdlxsh.z21.blob.storage.azure.net:443
md-hdd-dxgvrxd2cnjf.z22.blob.storage.azure.net:443
objects.githubusercontent.com:443
packages.microsoft.com:443
plugins-artifacts.gradle.org:443
plugins.gradle.org:443
ppa.launchpadcontent.net:443
ppa.launchpad.net:80
production.cloudflare.docker.com:443
quay.io:443
services.gradle.org:443
registry-1.docker.io:443
registry.access.redhat.com:443
registry.k8s.io:443
repo1.maven.org:443
repo.maven.apache.org:443
repository.jboss.org:443
storage.googleapis.com:443
us-south1-docker.pkg.dev:443
us-west2-docker.pkg.dev:443
us-east4-docker.pkg.dev:443
- name: Install and Run Integration Tests
run: |
JKUBE_VERSION=$(./mvnw -q -f 'jkube/pom.xml' -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
&& ./mvnw -B -PKubernetes,${{ matrix.suite }} clean verify -Djkube.version="$JKUBE_VERSION"
- name: Save reports as artifact
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: Test reports (Minikube ${{ matrix.kubernetes }}-${{ matrix.suite }})
path: ./it/target/jkube-test-report.txt
minikube-legacy:
name: K8S
needs: build-jkube
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
suite: ['quarkus','quarkus-native','springboot','webapp','other','dockerfile']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Java 11
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: '11'
distribution: 'temurin'
- name: Cache configuration
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.m2/repository
./jkube
key: cache-it-${{ github.run_id }}
- name: Setup Minikube-Kubernetes
uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d
with:
minikube version: v1.31.2
kubernetes version: v1.12.10
github token: ${{ secrets.GITHUB_TOKEN }}
start args: --force
- name: Harden Runner
uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
auth.docker.io:443
azure.archive.ubuntu.com:80
cdn03.quay.io:443
downloads.gradle.org:443
gcr.io:443
github.com:443
jcenter.bintray.com:443
k8s.gcr.io:443
maven.repository.redhat.com:443
md-hdd-51w5snc21ccf.z49.blob.storage.azure.net:443
md-hdd-bfh3mwcdlxsh.z21.blob.storage.azure.net:443
md-hdd-dxgvrxd2cnjf.z22.blob.storage.azure.net:443
objects.githubusercontent.com:443
packages.microsoft.com:443
plugins-artifacts.gradle.org:443
plugins.gradle.org:443
ppa.launchpadcontent.net:443
ppa.launchpad.net:80
production.cloudflare.docker.com:443
quay.io:443
services.gradle.org:443
registry-1.docker.io:443
registry.access.redhat.com:443
registry.k8s.io:443
repo1.maven.org:443
repo.maven.apache.org:443
repository.jboss.org:443
storage.googleapis.com:443
us-south1-docker.pkg.dev:443
us-west2-docker.pkg.dev:443
us-east4-docker.pkg.dev:443
- name: Install and Run Integration Tests
run: |
JKUBE_VERSION=$(./mvnw -q -f 'jkube/pom.xml' -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
&& ./mvnw -B -PKubernetes,${{ matrix.suite }} clean verify -Djkube.version="$JKUBE_VERSION"
- name: Save reports as artifact
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: Test reports (Minikube ${{ matrix.kubernetes }}-${{ matrix.suite }})
path: ./it/target/jkube-test-report.txt
openshift:
name: OpenShift
needs: build-jkube
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
openshift: [v3.10.0]
suite: ['quarkus','springboot','webapp','other']
steps:
# This seems to cause problems with OpenShift Setup Action
# - name: Harden Runner
# uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85
# with:
# egress-policy: audit
- name: Free up Space
# 'linux-headers.*' \ # Takes > 2 minutes
# 'google-cloud.*' \
run: |
sudo apt list --installed
sudo apt-get purge -y \
'aspnetcore.*' \
'cabal-install.*' \
'clang.*' \
'dotnet.*' \
'firefox.*' \
'ghc.*' \
'google-chrome.*' \
'libmagic.*' \
'libmono.*' \
'mono-.*' \
'mysql.*' \
'php.*' \
'ruby.*'
sudo apt-get autoremove
df -h
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Java 11
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: '11'
distribution: 'temurin'
- name: Cache configuration
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.m2/repository
./jkube
key: cache-it-${{ github.run_id }}
- name: Check Docker Status
run: systemctl status docker.service
- name: Setup OpenShift
uses: manusa/actions-setup-openshift@e59fe3caa18d7cde81e2ce4797e6549a13f7648c
with:
oc version: ${{ matrix.openshift }}
github token: ${{ secrets.GITHUB_TOKEN }}
- name: Install and Run Integration Tests
run: |
JKUBE_VERSION=$(./mvnw -q -f 'jkube/pom.xml' -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
&& ./mvnw -B -POpenShift,${{ matrix.suite }} verify -Djkube.version="$JKUBE_VERSION" -Djunit.jupiter.execution.parallel.config.fixed.parallelism=4
- name: Save reports as artifact
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: Test reports (OpenShift ${{ matrix.openshift }}-${{ matrix.suite }})
path: ./it/target/jkube-test-report.txt
- name: Cluster Information
if: always()
run: |
oc login -u system:admin
oc describe node localhost
oc login -u developer