1
1
name : cldr-mvn
2
2
3
+ env :
4
+ # # uncomment only ONE of these
5
+ CLDR_CHECK_MODE : FINAL_TESTING
6
+ # CLDR_CHECK_MODE: BUILD
7
+
3
8
on :
4
9
push :
5
10
pull_request :
@@ -40,22 +45,30 @@ jobs:
40
45
${{ runner.os }}-mavenspotless-
41
46
- name : Check Java style
42
47
run : mvn --file=tools/pom.xml spotless:check || (echo "Style checker failed. Formatting changes can be applied by 'mvn spotless:apply'" && exit 1)
43
- build :
48
+ - name : Restore lychee cache
49
+ uses : actions/cache@v3
50
+ with :
51
+ path : .lycheecache
52
+ key : cache-lychee-${{ github.sha }}
53
+ restore-keys : cache-lychee-
54
+ - name : Run lychee on PathDescriptions.md
55
+ uses : lycheeverse/lychee-action@v1
56
+ with :
57
+ args : " -n --cache --max-cache-age 10d tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/PathDescriptions.md"
58
+ fail : true
59
+ format : markdown
60
+ output : linkcheck.md
61
+ - name : Link Checker Summary PathDescriptions.md
62
+ run : cat linkcheck.md >> $GITHUB_STEP_SUMMARY
63
+ package :
64
+ name : " Package up CLDR"
44
65
runs-on : ubuntu-latest
45
66
steps :
46
67
- name : Clone Repository
47
68
uses : actions/checkout@v4
48
69
with :
49
70
lfs : false
50
71
fetch-depth : 0 # Needed for cldr-archive
51
- if : github.event.inputs.git-ref == ''
52
- - name : Clone Repository (manual ref)
53
- uses : actions/checkout@v4
54
- with :
55
- lfs : false
56
- fetch-depth : 0 # Needed for cldr-archive
57
- ref : ${{ github.event.inputs.git-ref }}
58
- if : github.event.inputs.git-ref != ''
59
72
- name : Set up JDK
60
73
uses : actions/setup-java@v4
61
74
with :
@@ -97,18 +110,14 @@ jobs:
97
110
env :
98
111
DATADOG_SITE : ${{ secrets.DATADOG_SITE }}
99
112
DATADOG_API_KEY : ${{ secrets.DATADOG_API_KEY }}
100
- - name : Checkout CLDR archive
101
- run : >
102
- mkdir -v ../cldr-archive && java -jar tools/cldr-code/target/cldr-code.jar checkout-archive
103
- env :
104
- GIT_LFS_SKIP_SMUDGE : 1
105
113
- name : Build liberty server
106
114
run : >
107
115
mvn -s .github/workflows/mvn-settings.xml -B -pl cldr-apps liberty:create liberty:deploy liberty:package -Dinclude=usr --file tools/pom.xml
108
116
-DskipTests=true
109
117
env :
110
118
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
111
119
- name : Cleanup liberty server
120
+ # we remove the 'expanded' version of the .war file, to save space
112
121
run : >
113
122
zip tools/cldr-apps/target/cldr-apps.zip -d wlp/usr/servers/cldr/apps/expanded/\*
114
123
- name : Upload cldr-apps.zip
@@ -121,34 +130,63 @@ jobs:
121
130
with :
122
131
name : cldr-code
123
132
path : tools/cldr-code/target/cldr-code.jar
124
- - name : BOM check in .xml files
125
- run : >
126
- mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
127
- exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
128
- -Dexec.cleanupDaemonThreads=false
129
- -Dexec.args="-q --justCheckBom exemplars seed common keyboards"
130
- && echo 'No XML BOM detected'
131
- - name : Schema check common/main in .xml files
132
- run : >
133
- mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
134
- exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
135
- -Dexec.cleanupDaemonThreads=false
136
- -Dexec.args="-q --schema=common/dtd/ldml.xsd common/main"
137
- || (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
138
- - name : Keyboard Schema Check
133
+ build :
134
+ # Cannot change the name, it's a required step.
135
+ # name: "Build / Unit-test"
136
+ runs-on : ubuntu-latest
137
+ steps :
138
+ - name : Clone Repository
139
+ uses : actions/checkout@v4
140
+ with :
141
+ lfs : false
142
+ fetch-depth : 0 # Needed for cldr-archive
143
+ if : github.event.inputs.git-ref == ''
144
+ - name : Clone Repository (manual ref)
145
+ uses : actions/checkout@v4
146
+ with :
147
+ lfs : false
148
+ fetch-depth : 0 # Needed for cldr-archive
149
+ ref : ${{ github.event.inputs.git-ref }}
150
+ if : github.event.inputs.git-ref != ''
151
+ - name : Set up JDK
152
+ uses : actions/setup-java@v4
153
+ with :
154
+ java-version : 11
155
+ distribution : ' temurin'
156
+ - name : Cache local Maven repository
157
+ uses : actions/cache@v4
158
+ with :
159
+ path : ~/.m2/repository
160
+ key : ${{ runner.os }}-maven-${{ hashFiles('tools/**/pom.xml') }}
161
+ restore-keys : |
162
+ ${{ runner.os }}-maven-
163
+ - name : Cache local npm repository
164
+ uses : actions/cache@v4
165
+ with :
166
+ path : ~/.npm
167
+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
168
+ restore-keys : |
169
+ ${{ runner.os }}-node-
170
+ node-
171
+ - name : Cache webpack
172
+ uses : actions/cache@v4
173
+ with :
174
+ path : tools/cldr-apps/target/webpack_cache
175
+ key : ${{ runner.os }}-webpack-${{ hashFiles('tools/cldr-apps/package*') }}-${{ hashFiles('tools/cldr-apps/src/**') }}
176
+ restore-keys : |
177
+ ${{ runner.os }}-webpack-
178
+ webpack-
179
+ - name : Build with Maven
139
180
run : >
140
- mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
141
- exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
142
- -Dexec.cleanupDaemonThreads=false
143
- -Dexec.args="--schema=keyboards/dtd/ldmlKeyboard.xsd keyboards/3.0"
144
- || (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
145
- - name : Keyboard Test Schema Check
181
+ mvn -s .github/workflows/mvn-settings.xml -B compile install package --file tools/pom.xml
182
+ -DskipTests=true
183
+ env :
184
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185
+ - name : Checkout CLDR archive
146
186
run : >
147
- mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
148
- exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
149
- -Dexec.cleanupDaemonThreads=false
150
- -Dexec.args="--schema=keyboards/dtd/ldmlKeyboardTest.xsd keyboards/test"
151
- || (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
187
+ mkdir -v ../cldr-archive && java -jar tools/cldr-code/target/cldr-code.jar checkout-archive
188
+ env :
189
+ GIT_LFS_SKIP_SMUDGE : 1
152
190
- name : Setup MySQL
153
191
run : |
154
192
sudo systemctl start mysql.service
@@ -165,6 +203,8 @@ jobs:
165
203
env :
166
204
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
167
205
check :
206
+ # Cannot change the name, it's a required step.
207
+ # name: "Run ConsoleCheckCLDR"
168
208
runs-on : ubuntu-latest
169
209
steps :
170
210
- name : Clone Repository
@@ -196,14 +236,102 @@ jobs:
196
236
env :
197
237
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
198
238
- name : run CLDR console check
199
- run : java -DCLDR_GITHUB_ANNOTATIONS=true -DCLDR_DIR=$(pwd) -Xmx6g -jar tools/cldr-code/target/cldr-code.jar check -S common,seed -e -z FINAL_TESTING
239
+ run : java -DCLDR_GITHUB_ANNOTATIONS=true -DCLDR_DIR=$(pwd) -Xmx6g -jar tools/cldr-code/target/cldr-code.jar check -S common,seed -e -z ${CLDR_CHECK_MODE}
240
+ - name : BOM check in .xml files
241
+ run : >
242
+ mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
243
+ exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
244
+ -Dexec.cleanupDaemonThreads=false
245
+ -Dexec.args="-q --justCheckBom exemplars seed common keyboards"
246
+ && echo 'No XML BOM detected'
247
+ - name : Schema check common/main in .xml files
248
+ run : >
249
+ mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
250
+ exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
251
+ -Dexec.cleanupDaemonThreads=false
252
+ -Dexec.args="-q --schema=common/dtd/ldml.xsd common/main"
253
+ || (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
254
+ - name : Keyboard Schema Check
255
+ run : >
256
+ mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
257
+ exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
258
+ -Dexec.cleanupDaemonThreads=false
259
+ -Dexec.args="--schema=keyboards/dtd/ldmlKeyboard.xsd keyboards/3.0"
260
+ || (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
261
+ - name : Keyboard Test Schema Check
262
+ run : >
263
+ mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
264
+ exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
265
+ -Dexec.cleanupDaemonThreads=false
266
+ -Dexec.args="--schema=keyboards/dtd/ldmlKeyboardTest.xsd keyboards/test"
267
+ || (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
268
+ servertest :
269
+ name : " Docker test cldr-apps"
270
+ needs :
271
+ - package
272
+ runs-on : ubuntu-latest
273
+ steps :
274
+ - name : Clone Repository
275
+ uses : actions/checkout@v4
276
+ with :
277
+ lfs : false
278
+ - run : mkdir -p tools/cldr-apps/target
279
+ - name : Download cldr-apps.zip
280
+ uses : actions/download-artifact@v4
281
+ with :
282
+ name : cldr-apps-server
283
+ path : tools/cldr-apps/target/cldr-apps.zip
284
+ - name : Cache local Maven repository
285
+ uses : actions/cache@v4
286
+ with :
287
+ path : ~/.m2/repository
288
+ key : ${{ runner.os }}-mavencheck-${{ hashFiles('tools/**/pom.xml') }}
289
+ restore-keys : |
290
+ ${{ runner.os }}-mavencheck-
291
+ - name : Cache local npm repository
292
+ uses : actions/cache@v4
293
+ with :
294
+ path : ~/.npm
295
+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
296
+ restore-keys : |
297
+ ${{ runner.os }}-node-
298
+ node-
299
+ - name : Pull Images
300
+ run : docker compose pull -q
301
+ working-directory : tools/cldr-apps
302
+ - name : Build Containers
303
+ run : docker compose build
304
+ working-directory : tools/cldr-apps
305
+ - name : Bringup Containers
306
+ run : docker compose up -d cldr-apps selenium
307
+ working-directory : tools/cldr-apps
308
+ - name : Build webdriver
309
+ run : docker compose run -v ~/.m2/repository:/root/.m2/repository:rw --rm webdriver mvn -B test-compile
310
+ working-directory : tools/cldr-apps
311
+ - name : Test with Webdriver
312
+ # See tools/cldr-apps/README.md
313
+ run : >
314
+ docker compose run -v ~/.m2/repository:/root/.m2/repository:rw --rm webdriver || ( docker compose exec -it cldr-apps tail /logs/messages.log ; true )
315
+ working-directory : tools/cldr-apps
316
+ - name : Prepare client tests
317
+ run : docker run --rm -v ~/.npm:/root/.npm:rw -v $(pwd)/js:/home/node/app:rw -w /home/node/app node npm ci
318
+ working-directory : tools/cldr-apps
319
+ - name : Run client tests against ST
320
+ run : docker compose run --rm client-test || ( docker compose exec -it cldr-apps tail /logs/messages.log ; false )
321
+ working-directory : tools/cldr-apps
322
+ - name : Shut down containers
323
+ run : docker compose stop || true
324
+ working-directory : tools/cldr-apps
200
325
deploy :
326
+ name : " Deploy to cldr-smoke for testing"
201
327
# don't run deploy on manual builds!
202
328
if : github.repository == 'unicode-org/cldr' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.inputs.git-ref == ''
203
329
needs :
204
330
- build
205
331
- check
206
332
- formatter
333
+ - package
334
+ # - servertest
207
335
runs-on : ubuntu-latest
208
336
steps :
209
337
- name : Download cldr-apps.zip
0 commit comments