-
Notifications
You must be signed in to change notification settings - Fork 1
243 lines (236 loc) · 9.32 KB
/
e2e.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
name: JKube E2E Tests
on:
repository_dispatch:
types: [pull_request]
env:
ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
permissions:
contents: read
jobs:
bootstrap-CI-test-run:
name: Bootstrap CI test run (#${{ github.event.client_payload.pr }})
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Cache .m2 and JKube
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: |
${{ github.workspace }}/jkube
${{ github.workspace }}/jkube-it
~/.m2/repository
key: cache-e2e-bootstrap-${{ github.run_id }}
- name: Bootstrap
run: |
node src/index.js init \
--pr=${{ github.event.client_payload.pr }} \
--runId=${{ github.run_id }}
- name: Checkout repositories and Install JKube
run: |
node src/index.js checkout \
--pr=${{ github.event.client_payload.pr }} \
--runId=${{ github.run_id }}
minikube:
name: K8S ${{ matrix.kubernetes }} ${{ matrix.suite }} (#${{ github.event.client_payload.pr }})
needs: bootstrap-CI-test-run
runs-on: ubuntu-latest
timeout-minutes: 30
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@v4
- name: Restore cache .m2 and JKube
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: |
${{ github.workspace }}/jkube
${{ github.workspace }}/jkube-it
~/.m2/repository
key: cache-e2e-bootstrap-${{ github.run_id }}
- name: Update PR report status
run: |
node src/index.js update-status \
--pr=${{ github.event.client_payload.pr }} \
--runId=${{ github.run_id }}
- name: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Minikube-Kubernetes
uses: manusa/[email protected]
with:
minikube version: v1.31.2
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}
start args: --force
- name: Install and Run Integration Tests
run: |
JKUBE_VERSION=$(mvn -f jkube/pom.xml -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
&& cd jkube-it \
&& ./mvnw -B -PKubernetes,${{ matrix.suite }} verify -Djkube.version="$JKUBE_VERSION"
- name: Consolidate reports
if: always()
run: |
mkdir -p ./reports \
&& cp ./jkube-it/it/target/jkube-test-report.txt ./reports
- name: Save reports as artifact
if: always()
uses: actions/upload-artifact@master
with:
name: Test reports (Minikube ${{ matrix.kubernetes }}-${{ matrix.suite }})
path: ./reports
- name: Update PR report status
if: always()
run: |
node src/index.js update-status \
--pr=${{ github.event.client_payload.pr }} \
--runId=${{ github.run_id }}
openshift:
name: OpenShift ${{ matrix.openshift }} ${{ matrix.suite }} (#${{ github.event.client_payload.pr }})
needs: bootstrap-CI-test-run
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
openshift: [v3.10.0]
suite: ['quarkus','springboot','webapp','other']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache .m2 and JKube
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: |
${{ github.workspace }}/jkube
${{ github.workspace }}/jkube-it
~/.m2/repository
key: cache-e2e-bootstrap-${{ github.run_id }}
- name: Update PR report status
run: |
node src/index.js update-status \
--pr=${{ github.event.client_payload.pr }} \
--runId=${{ github.run_id }}
- name: Free up Space
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: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup OpenShift
uses: manusa/[email protected]
with:
oc version: ${{ matrix.openshift }}
github token: ${{ secrets.GITHUB_TOKEN }}
- name: Install and Run Integration Tests
run: |
JKUBE_VERSION=$(mvn -f jkube/pom.xml -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
&& cd jkube-it \
&& ./mvnw -B -POpenShift,${{ matrix.suite }} verify -Djkube.version="$JKUBE_VERSION" -Djunit.jupiter.execution.parallel.config.fixed.parallelism=4
- name: Consolidate reports
if: always()
run: |
mkdir -p ./reports \
&& cp ./jkube-it/it/target/jkube-test-report.txt ./reports
- name: Save reports as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: Test reports (OpenShift ${{ matrix.openshift }}-${{ matrix.suite }})
path: ./reports
- name: Update PR report status
if: always()
run: |
node src/index.js update-status \
--pr=${{ github.event.client_payload.pr }} \
--runId=${{ github.run_id }}
windows:
name: Windows (#${{ github.event.client_payload.pr }})
needs: bootstrap-CI-test-run
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Allow long Git filenames in Windows
run: git config --system core.longpaths true
- name: Update PR report status
run: |
node src/index.js update-status --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }}
- name: Checkout repositories and Install JKube
run: |
node src/index.js checkout --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }}
- name: Install and Run Integration Tests
run: |
$env:JKUBE_VERSION = (mvn -f jkube\pom.xml org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression='project.version' -q -DforceStdout) | Out-String
echo $env:JKUBE_VERSION
cd jkube-it
mvn -B -PWindows clean verify -D'jkube.version'=$env:JKUBE_VERSION
- name: Consolidate reports
if: always()
run: |
mkdir reports
cp jkube-it\it\target\jkube-test-report.txt reports
- name: Save reports as artifact
if: always()
uses: actions/upload-artifact@master
with:
name: Test reports (Windows)
path: ./reports
- name: Update PR report status
if: always()
run: |
node src/index.js update-status --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }}
# Trigger the e2e-report workflow so that the complete report gets published
teardown:
name: Finish CI test run
runs-on: ubuntu-latest
needs: [minikube, openshift, windows]
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update PR report status
run: |
node src/index.js update-status --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }}
- name: Trigger report workflow
run: |
curl -X POST \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-u "${{ secrets.GH_ACCESS_TOKEN_USER }}:${{ secrets.GH_ACCESS_TOKEN }}" \
-d '{"event_type":"generate_report","client_payload":{"pr":"${{ github.event.client_payload.pr }}","e2e_run_id":"${{ github.run_id }}"}}'