Repository navigation
358 lines (355 loc) · 14 KB
/
Copy pathmaven.yml
File metadata and controls
358 lines (355 loc) · 14 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
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
name: cldr-mvn
env:
## uncomment only ONE of these
# CLDR_CHECK_MODE: FINAL_TESTING
CLDR_CHECK_MODE: BUILD
on:
push:
pull_request:
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
jobs:
formatter:
name: Formatter + Style checker
runs-on: ubuntu-latest
steps:
# since we have to checkout all branches, cache here
- name: Cache .git
uses: actions/cache@v4
with:
path: .git
key: git-${{ github.base_ref }}-${{ github.sha }}
restore-keys: |
git-${{ github.base_ref }}-${{ github.sha }}
git-${{ github.base_ref }}
git-
- name: Checkout CLDR
uses: actions/checkout@v4
with:
lfs: false
fetch-depth: 0 # fetch all branches so that Spotless can resolve `origin/main`
- name: Lint GitHub Actions
run: npx yaml-lint .github/workflows/*.yml
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mavenspotless-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-mavenspotless-
- name: Check Java style
run: mvn --file=tools/pom.xml spotless:check || (echo "Style checker failed. Formatting changes can be applied by 'mvn spotless:apply'" && exit 1)
- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Run lychee on PathDescriptions.md
uses: lycheeverse/lychee-action@v1
with:
args: "-n --cache --max-cache-age 10d tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/PathDescriptions.md"
fail: true
format: markdown
output: linkcheck.md
- name: Link Checker Summary PathDescriptions.md
run: cat linkcheck.md >> $GITHUB_STEP_SUMMARY
package:
name: "Package up CLDR"
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
lfs: false
fetch-depth: 0 # Needed for cldr-archive
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache local npm repository
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-
- name: Cache webpack
uses: actions/cache@v4
with:
path: tools/cldr-apps/target/webpack_cache
key: ${{ runner.os }}-webpack-${{ hashFiles('tools/cldr-apps/package*') }}-${{ hashFiles('tools/cldr-apps/src/**') }}
restore-keys: |
${{ runner.os }}-webpack-
webpack-
- name: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile install package --file tools/pom.xml
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: DataDog sourcemap upload
# only on push to main!
if: github.repository == 'unicode-org/cldr' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.inputs.git-ref == ''
run: npx --package=@datadog/datadog-ci datadog-ci sourcemaps upload tools/cldr-apps/src/main/webapp/dist/ --minified-path-prefix=/cldr-apps/dist/ --release-version=r${{ github.sha }} --service=surveytool
env:
DATADOG_SITE: ${{ secrets.DATADOG_SITE }}
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
- name: Build liberty server
run: >
mvn -s .github/workflows/mvn-settings.xml -B -pl cldr-apps liberty:create liberty:deploy liberty:package -Dinclude=usr --file tools/pom.xml
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup liberty server
# we remove the 'expanded' version of the .war file, to save space
run: >
zip tools/cldr-apps/target/cldr-apps.zip -d wlp/usr/servers/cldr/apps/expanded/\*
- name: Upload cldr-apps.zip
uses: actions/upload-artifact@v4
with:
name: cldr-apps-server
path: tools/cldr-apps/target/cldr-apps.zip
- name: Upload cldr-code.jar
uses: actions/upload-artifact@v4
with:
name: cldr-code
path: tools/cldr-code/target/cldr-code.jar
build:
#Cannot change the name, it's a required step.
#name: "Build / Unit-test"
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
lfs: false
fetch-depth: 0 # Needed for cldr-archive
if: github.event.inputs.git-ref == ''
- name: Clone Repository (manual ref)
uses: actions/checkout@v4
with:
lfs: false
fetch-depth: 0 # Needed for cldr-archive
ref: ${{ github.event.inputs.git-ref }}
if: github.event.inputs.git-ref != ''
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache local npm repository
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-
- name: Cache webpack
uses: actions/cache@v4
with:
path: tools/cldr-apps/target/webpack_cache
key: ${{ runner.os }}-webpack-${{ hashFiles('tools/cldr-apps/package*') }}-${{ hashFiles('tools/cldr-apps/src/**') }}
restore-keys: |
${{ runner.os }}-webpack-
webpack-
- name: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile install package --file tools/pom.xml
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout CLDR archive
run: >
mkdir -v ../cldr-archive && java -jar tools/cldr-code/target/cldr-code.jar checkout-archive
env:
GIT_LFS_SKIP_SMUDGE: 1
- name: Setup MySQL
run: |
sudo systemctl start mysql.service
sleep 3
mysql --user=root --password=root < tools/cldr-apps/test-setup.sql
- name: Test with maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B test --file tools/pom.xml
'-Dorg.unicode.cldr.unittest.web.jdbcurl=jdbc:mysql://cldrtest:VbrB3LFCr6A!@localhost/cldrtest?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC'
'-Dorg.unicode.cldr.unittest.web.KeepDb=true' -DCLDR_GITHUB_ANNOTATIONS=true
'-Dorg.unicode.cldr.unittest.testArgs=-e10 -n'
'-Dorg.unicode.cldr.unittest.web.testArgs=-e10 -n'
'-Dorg.unicode.cldr.api.testArgs=-e10 -n'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check:
#Cannot change the name, it's a required step.
#name: "Run ConsoleCheckCLDR"
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
lfs: false
if: github.event.inputs.git-ref == ''
- name: Clone Repository (manual ref)
uses: actions/checkout@v4
with:
lfs: false
ref: ${{ github.event.inputs.git-ref }}
if: github.event.inputs.git-ref != ''
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mavencheck-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-mavencheck-
- name: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile package --file tools/pom.xml -pl cldr-code -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: run CLDR console check
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}
- name: BOM check in .xml files
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="-q --justCheckBom exemplars seed common keyboards"
&& echo 'No XML BOM detected'
- name: Schema check common/main in .xml files
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="-q --schema=common/dtd/ldml.xsd common/main"
|| (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
- name: Keyboard Schema Check
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="--schema=keyboards/dtd/ldmlKeyboard.xsd keyboards/3.0"
|| (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
- name: Keyboard Test Schema Check
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="--schema=keyboards/dtd/ldmlKeyboardTest.xsd keyboards/test"
|| (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
servertest:
name: "Docker test cldr-apps"
needs:
- package
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
lfs: false
- run: mkdir -p tools/cldr-apps/target
- name: Download cldr-apps.zip
uses: actions/download-artifact@v4
with:
name: cldr-apps-server
path: tools/cldr-apps/target/cldr-apps.zip
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mavencheck-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-mavencheck-
- name: Cache local npm repository
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-
- name: Pull Images
run: docker compose pull -q
working-directory: tools/cldr-apps
- name: Build Containers
run: docker compose build
working-directory: tools/cldr-apps
- name: Bringup Containers
run: docker compose up -d cldr-apps selenium
working-directory: tools/cldr-apps
- name: Build webdriver
run: docker compose run -v ~/.m2/repository:/root/.m2/repository:rw --rm webdriver mvn -B test-compile
working-directory: tools/cldr-apps
- name: Test with Webdriver
# See tools/cldr-apps/README.md
run: >
docker compose run -v ~/.m2/repository:/root/.m2/repository:rw --rm webdriver || ( docker compose exec -it cldr-apps tail /logs/messages.log ; false )
working-directory: tools/cldr-apps
- name: Prepare client tests
run: docker run --rm -v ~/.npm:/root/.npm:rw -v $(pwd)/js:/home/node/app:rw -w /home/node/app node npm ci
working-directory: tools/cldr-apps
- name: Run client tests against ST
run: docker compose run --rm client-test || ( docker compose exec -it cldr-apps tail /logs/messages.log ; false )
working-directory: tools/cldr-apps
- name: Shut down containers
run: docker compose stop || true
working-directory: tools/cldr-apps
deploy:
name: "Deploy to cldr-smoke for testing"
# don't run deploy on manual builds!
if: github.repository == 'unicode-org/cldr' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.inputs.git-ref == ''
needs:
- build
- check
- formatter
- package
# - servertest
runs-on: ubuntu-latest
steps:
- name: Download cldr-apps.zip
uses: actions/download-artifact@v4
with:
name: cldr-apps-server
- name: Deploy to cldr-smoke
# Deploys only on push to main.
# Does not deploy for PRs.
if: ${{ github.event_name == 'push' }}
shell: bash
env:
# the RSA key for connecting
RSA_KEY_SURVEYTOOL: ${{ secrets.RSA_KEY_SURVEYTOOL }}
# the SSH port
SMOKETEST_PORT: ${{ secrets.SMOKETEST_PORT }}
# the SSH host
SMOKETEST_HOST: ${{ secrets.SMOKETEST_HOST }}
# the ~/.ssh/known_hosts line mentioning SMOKETEST_HOST
SMOKETEST_KNOWNHOSTS: ${{ secrets.SMOKETEST_KNOWNHOSTS }}
run: |
echo "${RSA_KEY_SURVEYTOOL}" > .key && chmod go= .key
echo "${SMOKETEST_KNOWNHOSTS}" > .knownhosts && chmod go= .knownhosts
ssh -C -o UserKnownHostsFile=.knownhosts -i .key -p ${SMOKETEST_PORT} surveytool@${SMOKETEST_HOST} bash /usr/local/bin/deploy-to-openliberty.sh < cldr-apps.zip ${GITHUB_SHA} --override