-
Notifications
You must be signed in to change notification settings - Fork 1
214 lines (190 loc) · 8.61 KB
/
Copy pathrun-integration-tests.yml
File metadata and controls
214 lines (190 loc) · 8.61 KB
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
name: Run integration tests
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
persistence:
strategy:
fail-fast: false
matrix:
project: [persistence-it-hibernate]
parallel: [0, 2]
pre-start: [false, true]
java: [25]
include:
- project: persistence-it-eclipselink
parallel: 2
pre-start: true
java: 25
name: "persistence (${{matrix.project}}, ${{matrix.parallel}}, ${{matrix.pre-start}}, ${{matrix.java}})"
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- parallel:
- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Cache Maven
uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-it-build-persistence-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
- name: Docker Image Cache Restore
id: docker-image-cache-restore
uses: ./.github/actions/docker-image-cache/restore
with:
# This cache could always change however because docker images can be changed remotely if the version is not fixated
# As a compromise it utilizes the hash of the pom files because when the dependencies stay the same
# the images should also be roughly the same
key: ${{ runner.os }}-it-docker-images-persistence-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-docker-images-persistence-${{ matrix.project }}-
- name: Setup Buildx
id: docker-image-cache-setup-buildx
uses: ./.github/actions/docker-image-cache/setup-buildx
- name: Test
run: |
./mvnw -B test \
-pl "demos/advanced-demo/integration-tests/${{ matrix.project }}" -am \
-T2C \
-P run-it \
-Dchecks.disable=true \
-Dlicense.skip \
${{ matrix.pre-start && '-Dtci.infra-pre-start.enabled=1 ' || '' }} \
${{ matrix.parallel > 0 && format('-Djunit.jupiter.execution.parallel.enabled=true -Djunit.jupiter.execution.parallel.mode.default=concurrent -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2 -Djunit.jupiter.execution.parallel.config.fixed.max-pool-size={0} ', matrix.parallel) || '' }}
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RESULTS_URL }}
- name: Show images
run: docker image ls
- name: Docker Image Cache Save
uses: ./.github/actions/docker-image-cache/save
with:
key: ${{ steps.docker-image-cache-restore.outputs.key }}
cache-hit: ${{ steps.docker-image-cache-restore.outputs.cache-hit }}
selenium:
strategy:
fail-fast: false
matrix:
project: [webapp-it]
parallel: [0, 2]
pre-start: [false, true]
java: [25]
jacoco: [false]
# Dedicated build with JaCoCo
include:
- project: webapp-it
parallel: 2
pre-start: true
java: 25
jacoco: true
name: "selenium (${{matrix.project}}, ${{matrix.parallel }}, ${{matrix.pre-start}}, ${{matrix.java}}${{ matrix.jacoco && ', JaCoCo' || '' }})"
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- parallel:
- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Cache Maven
uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-it-build-selenium-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
- name: Docker Image Cache Restore
id: docker-image-cache-restore
uses: ./.github/actions/docker-image-cache/restore
with:
# This cache could always change however because docker images can be changed remotely if the version is not fixated
# As a compromise it utilizes the hash of the pom files because when the dependencies stay the same
# the images should also be roughly the same
key: ${{ runner.os }}-it-docker-images-selenium-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-docker-images-selenium-${{ matrix.project }}-
- name: Setup Buildx
id: docker-image-cache-setup-buildx
uses: ./.github/actions/docker-image-cache/setup-buildx
- name: Report CPU details
run: |
cat /proc/cpuinfo | grep -P '^model name' | uniq
cat /proc/cpuinfo | grep -P '^flags' | uniq
- name: Test
run: |
# Differentiate cache between AVX microcode used by Java (until https://github.com/xdev-software/tci/issues/688 is fixed)
java_useavx=$(java -XX:+PrintFlagsFinal -version 2> /dev/null | awk '/UseAVX/ {print $4}')
echo "Java UseAVX: ${java_useavx}"
./mvnw -B test \
-pl "demos/advanced-demo/integration-tests/${{ matrix.project }}" -am \
-T2C \
-P run-it${{ matrix.jacoco && ',jacoco' || '' }} \
-Dlicense.skip \
-Dtci.image-build.delete-on-exit=true \
-Dtci.image-build.cache-from="type=gha,scope=§image" \
-Dtci.image-build.cache-to="type=gha,mode=max,scope=§image" \
-Dtci.image-build.tci-demo-webapp.cache-from="type=gha,scope=§image-j_avx${java_useavx}${{ matrix.jacoco && '-jacoco' || '' }}" \
-Dtci.image-build.tci-demo-webapp.cache-to="type=gha,mode=max,scope=§image-j_avx${java_useavx}${{ matrix.jacoco && '-jacoco' || '' }}" \
${{ matrix.pre-start && '-Dtci.infra-pre-start.enabled=1 ' || '' }} \
${{ matrix.parallel > 0 && format('-Djunit.jupiter.execution.parallel.enabled=true -Djunit.jupiter.execution.parallel.mode.default=concurrent -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2 -Djunit.jupiter.execution.parallel.config.fixed.max-pool-size={0} ', matrix.parallel) || '' }}
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RESULTS_URL }}
- name: Show images
run: docker image ls
- name: Docker Image Cache Save
uses: ./.github/actions/docker-image-cache/save
with:
key: ${{ steps.docker-image-cache-restore.outputs.key }}
cache-hit: ${{ steps.docker-image-cache-restore.outputs.cache-hit }}
background: true
- name: Upload videos of test failures
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: test-fail-videos-${{ matrix.java }}-${{ matrix.project }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
path: demos/advanced-demo/integration-tests/${{ matrix.project }}/target/records
if-no-files-found: ignore
- name: Aggregate WebApp JaCoCo report
if: ${{ matrix.jacoco && success() }}
# Important: Also run compile (if not already done) so that we have all class files - otherwise the report will be incomplete
run: |
./mvnw -B compile jacoco-aggregator:report-aggregate-all -pl webapp -am -T2C
working-directory: demos/advanced-demo
- name: Upload WebApp JaCoCo report
if: ${{ matrix.jacoco && success() }}
uses: actions/upload-artifact@v7
with:
name: webapp-jacoco-report-${{ matrix.java }}-${{ matrix.project }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
path: demos/advanced-demo/target/site/jacoco-aggregate
if-no-files-found: ignore
- name: Wait for async jobs to finish
wait-all: