-
-
Notifications
You must be signed in to change notification settings - Fork 479
258 lines (207 loc) · 7.31 KB
/
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
name: Tests
on:
- push
- pull_request
jobs:
test-java-8-war-generation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 8
check-latest: true
cache: "maven"
- name: Remove test code (not java 8 compatible)
run: rm -rf src/test
- name: Generate war file (including apache-jsp artifact)
run: mvn --batch-mode -f pom.jdk8.xml -D java.net.useSystemProxies=true -Dapache-jsp.scope=compile clean package
- name: Generate war file
run: mvn --batch-mode -f pom.jdk8.xml -D java.net.useSystemProxies=true clean package
- name: temporarily save generated files
uses: actions/upload-artifact@v3
with:
name: war-jre8
path: target/plantuml.war
retention-days: 1
test-java-8-war:
runs-on: ubuntu-latest
needs: test-java-8-war-generation
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: retrieve generated files (jre8)
uses: actions/download-artifact@v3
with:
name: war-jre8
path: artifacts
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Prepare jetty-runner tests
run: mvn --batch-mode clean package
- name: Start jetty server over jetty-runner
run: java -jar target/dependency/jetty-runner.jar --config src/main/config/jetty.xml --path /plantuml artifacts/plantuml.war &
- name: Wait 5 seconds (to let jetty-runner start the jetty server)
run: sleep 5s
- name: Run tests against "mvn jetty:run" server
run: mvn --batch-mode test -DskipTests=false -Dgroups=\!graphviz-test -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
test-mvn-livecycle:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Lifecycle - Step 1/8 - mvn clean
run: mvn --batch-mode clean
- name: Lifecycle - Step 2/8 - mvn validate
run: mvn --batch-mode validate
- name: Lifecycle - Step 3/8 - mvn compile
run: mvn --batch-mode compile
- name: Lifecycle - Step 4/8 - mvn test (with skipTests=true)
run: mvn --batch-mode test
- name: Lifecycle - Step 5/8 - mvn package
run: mvn --batch-mode package
- name: Lifecycle - Step 6/8 - mvn verify
run: mvn --batch-mode verify
- name: Lifecycle - Step 7/8 - mvn install
run: mvn --batch-mode install
- name: Lifecycle - Step 8/8 - mvn site
run: mvn --batch-mode site
test-embedded:
runs-on: ubuntu-latest
needs: test-mvn-livecycle
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Run tests against jetty embedded server
run: mvn --batch-mode clean test -DskipTests=false -Dgroups=\!graphviz-test
test-mvn-jetty-run:
runs-on: ubuntu-latest
needs: test-mvn-livecycle
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Prepare "mvn jetty:run" tests
run: mvn --batch-mode clean test
- name: Start jetty server over maven
run: mvn --batch-mode jetty:run &
- name: Wait 20 seconds (to let maven start the jetty server)
run: sleep 20s
- name: Run tests against "mvn jetty:run" server
run: mvn --batch-mode test -DskipTests=false -Dgroups=\!graphviz-test -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
test-jetty-runner:
runs-on: ubuntu-latest
needs: test-mvn-livecycle
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Prepare jetty-runner tests
run: mvn --batch-mode clean package
- name: Start jetty server over jetty-runner
run: java -jar target/dependency/jetty-runner.jar --config src/main/config/jetty.xml --path /plantuml target/plantuml.war &
- name: Wait 5 seconds (to let jetty-runner start the jetty server)
run: sleep 5s
- name: Run tests against "mvn jetty:run" server
run: mvn --batch-mode test -DskipTests=false -Dgroups=\!graphviz-test -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
test-jetty:
runs-on: ubuntu-latest
needs: test-mvn-livecycle
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Prepare external tests
run: mvn --batch-mode clean test
- name: Build the jetty docker stack
run: |
docker image build -f Dockerfile.jetty -t plantuml-server:local .
docker run -d --hostname=test.localhost -p 8080:8080 -e BASE_URL=plantuml plantuml-server:local
- name: Check running containers
run: docker ps
- name: run tests against jetty docker image
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
test-tomcat:
runs-on: ubuntu-latest
needs: test-mvn-livecycle
strategy:
matrix:
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
check-latest: true
cache: "maven"
- name: Prepare external tests
run: mvn --batch-mode clean test
- name: Build the tomcat docker stack
run: |
docker image build -f Dockerfile.tomcat -t plantuml-server:local .
docker run -d --hostname=test.localhost -p 8080:8080 -e BASE_URL=plantuml plantuml-server:local
- name: Check running containers
run: docker ps
- name: run tests against tomcat docker image
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"