-
-
Notifications
You must be signed in to change notification settings - Fork 743
908 lines (848 loc) · 38.5 KB
/
icu_merge_ci.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
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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
# Copyright (C) 2021 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action continuous integration script for ICU post-merge tasks.
name: GHA ICU Merge CI
on:
push:
branches:
- main
- 'maint/maint*'
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# For non-release branches (namely: PRs), only run CI on the most recent commit. Cancel
# runs on previous commits mid-flight when new commits are pushed.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-on-specific-branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'maint/') && github.ref != 'main' }}
env:
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
permissions:
contents: read
jobs:
# Initialize the Maven artifact cache
# Uses Java 8 because Java version not deemed significant for downloading
# artifacts
#
# This job is created according to the cache strategy of reuse from a single job:
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
icu4j-mvn-init-cache:
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Cache local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
# Download all of the artifacts needed for the code and build plugins
- name: Download all artifacts
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
# Test ICU4J with little-endian ICU4C data only
icu4j-little-endian-data-test:
needs: icu4j-mvn-init-cache
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '11'
- name: ICU4J little-endian
run: |
cd icu4c/source;
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ./runConfigureICU Linux;
make -j -l4.5 check;
mkdir /tmp/icu4j_data_test;
cp -P data/out/tmp/icudt*l* /tmp/icu4j_data_test/
cd ../../icu4j;
mvn ${SHARED_MVN_ARGS} clean;
mvn ${SHARED_MVN_ARGS} -Dicu4c.data.path=/tmp/icu4j_data_test install
# Compile libraries used by all ICU4C performance tests.
icu4c-store-perf-libs:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build ICU libraries
run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j -l4.5 all;
cd lib;
cp -Ps ../tools/ctestfw/libicutest* .
- name: Upload ICU libraries
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: icu-perf-libs
path: icu4c/source/lib
retention-days: 1
# Assorted ICU4C performance tests
icu4c-performance-tests:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4c-store-perf-libs
strategy:
fail-fast: false
matrix:
perf: [charperf, usetperf, utfperf]
include:
- perf: charperf
tests: TestIsAlpha TestIsUpper TestIsLower TestIsDigit TestIsSpace TestIsAlphaNumeric TestIsPrint TestIsControl TestToLower TestToUpper TestIsWhiteSpace
- perf: usetperf
tests: titlecase_letter_add titlecase_letter_contains titlecase_letter_iterator unassigned_add unassigned_contains unassigned_iterator pattern1 pattern2 pattern3
- perf: utfperf
tests: Roundtrip FromUnicode FromUTF8
file: "-f ../../icu4j/perf-tests/data/conversion/xuzhimo.txt"
flag: "-e gb18030"
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create directory for lib files
run: mkdir icu4c/source/perflib
- name: Get ICU libs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: icu-perf-libs
path: icu4c/source/lib
- name: Build and run ICU4C perf tests
run: |
cd icu4c/source;
./runConfigureICU Linux;
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/${{ matrix.perf }})
LD_LIBRARY_PATH=lib ./test/perf/${{ matrix.perf }}/${{ matrix.perf }} ${{ matrix.flag }} -t 5 -p 10 ${{ matrix.file }} ${{ matrix.tests }} | tee test/perf/results/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4c/source/test/perf/results/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# Assorted ICU4C performance tests using data files
icu4c-performance-tests-with-files:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4c-store-perf-libs
strategy:
fail-fast: false
# Matrix of test drivers and test data and, if applicable, flags. Note
# that GHA first excludes the 'exclude:' items from the total of
# combinations and then adds the 'include:' items.
matrix:
perf: [collperf, ustrperf, normperf]
data: [TestNames_Asian, TestNames_Chinese, TestNames_Japanese, TestNames_Japanese_h, TestNames_Japanese_k, TestNames_Korean, TestNames_Latin, TestNames_Russian, TestNames_SerbianSH, TestNames_SerbianSR, TestNames_Simplified_Chinese, TestNames_Thai, th18057, thesis, vfear11a]
include:
- perf: collperf
tests: TestIcu_KeyGen_null TestIcu_qsort_strcoll_null TestIcu_qsort_usekey TestIcu_BinarySearch_strcoll_null TestIcu_BinarySearch_usekey
- perf: ustrperf
tests: TestCtor TestCtor1 TestCtor2 TestCtor3 TestAssign TestAssign1 TestAssign2 TestGetch TestCatenate TestScan TestScan1 TestScan2
flag: "-l -u"
- perf: normperf
tests: TestICU_NFC_NFD_Text TestICU_NFC_NFC_Text TestICU_NFC_Orig_Text TestICU_NFD_NFD_Text TestICU_NFD_NFC_Text TestICU_NFD_Orig_Text
exclude:
- perf: collperf
data: th18057
- perf: collperf
data: thesis
- perf: collperf
data: vfear11a
- perf: ustrperf
data: TestNames_Japanese
- perf: ustrperf
data: thesis
- perf: ustrperf
data: vfear11a
- perf: normperf
data: TestNames_Simplified_Chinese
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create directory for lib files
run: mkdir icu4c/source/perflib
- name: Get ICU libs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: icu-perf-libs
path: icu4c/source/lib
- name: Build and run ICU4C perf tests
env:
DATA_FILE_PATH: ../../icu4j/perf-tests/data/collation
run: |
cd icu4c/source;
./runConfigureICU Linux;
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/${{ matrix.perf }} && mkdir -p results/${{ matrix.perf }}/${{ matrix.data }})
LD_LIBRARY_PATH=lib ./test/perf/${{ matrix.perf }}/${{ matrix.perf }} ${{ matrix.flag }} -t 5 -p 10 -f $DATA_FILE_PATH/${{ matrix.data }}.txt ${{ matrix.tests }} | tee test/perf/results/${{ matrix.perf }}/${{ matrix.data }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4c/source/test/perf/results/${{ matrix.perf }}/${{ matrix.data }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/${{ matrix.perf }}/${{ matrix.data }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# String search performance test
icu4c-strsrchperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4c-store-perf-libs
strategy:
fail-fast: false
# Matrix of locales and corresponding test data.
matrix:
locale: [de, en, fr, ja, ru, th, zh]
include:
- locale: de
data: udhr_deu_1996
- locale: en
data: udhr_eng
- locale: fr
data: udhr_fra
- locale: ja
data: udhr_jpn
- locale: ru
data: udhr_rus
- locale: th
data: udhr_tha
- locale: zh
data: udhr_cmn_hans
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create directory for lib files
run: mkdir icu4c/source/perflib
- name: Get ICU libs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: icu-perf-libs
path: icu4c/source/lib
- name: Build and run strschrperf test
env:
DATA_FILE_PATH: ../../icu4j/perf-tests/data/udhr
run: |
cd icu4c/source;
./runConfigureICU Linux;
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/strsrchperf && mkdir -p results/strsrchperf/${{ matrix.locale }})
LD_LIBRARY_PATH=lib ./test/perf/strsrchperf/strsrchperf -b Test_ICU_Forward_Search Test_ICU_Backward_Search -t 5 -p 10 -L ${{ matrix.locale }} -f $DATA_FILE_PATH/${{ matrix.data }}.txt | tee test/perf/results/strsrchperf/${{ matrix.locale }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4c/source/test/perf/results/strsrchperf/${{ matrix.locale }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/strsrchperf/${{ matrix.locale }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for Unicode sets
icu4j-unicodesetperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [UnicodeSetAdd, UnicodeSetContains, UnicodeSetIterate]
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run unicodesetperf test
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
git status
cd perf-tests;
mkdir -p perf/results/j_unicodesetperf/${{ matrix.perf }};
java -cp ./target/*:./target/dependency/* com.ibm.icu.dev.test.perf.UnicodeSetPerf ${{ matrix.perf }} -a -t 2 -p 4 [:Lt:] | tee perf/results/j_unicodesetperf/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_unicodesetperf/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_unicodesetperf/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for character APIs
icu4j-ucharacterperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run ucharacterperf test
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_ucharacterperf;
java -cp ./target/*:./target/dependency/* com.ibm.icu.dev.test.perf.UCharacterPerf -a -t 2 -p 4 0 ffff | tee perf/results/j_ucharacterperf/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_ucharacterperf/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_ucharacterperf
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for decimal formatting
icu4j-decimalformatperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [TestICUConstruction, TestICUParse, TestICUFormat]
locale: [en_US, de_DE]
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run decimalformatperf
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:./target/dependency/* com.ibm.icu.dev.test.perf.DecimalFormatPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -L ${{ matrix.locale }} "#,###.##" "1.234,56" -r 1 | tee perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for normalization
icu4j-normperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [TestICU_NFD_NFC_Text, TestICU_NFC_NFC_Text, TestICU_NFC_Orig_Text, TestICU_NFD_NFC_Text, TestICU_NFD_NFD_Text, TestICU_NFD_Orig_Text]
source_text: [TestNames_Asian, TestNames_Chinese, TestNames_SerbianSH]
mode: [-l]
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run normperf
env:
DATA_FILE_PATH: data/collation
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:./target/dependency/* com.ibm.icu.dev.test.perf.NormalizerPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -f $DATA_FILE_PATH/${{ matrix.source_text }}.txt -e UTF-8 ${{ matrix.mode }} | tee perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
cat perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for encoding conversion
icu4j-converterperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
source_text: [arabic, english, french, greek, hebrew, hindi, japanese, korean, s-chinese]
perf: [TestCharsetDecoderICU, TestCharsetEncoderICU]
test_enc: [UTF-8]
include:
- test_enc: csisolatinarabic
source_text: arabic
perf: TestCharsetDecoderICU
- test_enc: csisolatinarabic
source_text: arabic
perf: TestCharsetEncoderICU
- test_enc: csisolatin1
source_text: french
perf: TestCharsetDecoderICU
- test_enc: csisolatin1
source_text: french
perf: TestCharsetEncoderICU
- test_enc: csisolatingreek
source_text: greek
perf: TestCharsetDecoderICU
- test_enc: csisolatingreek
source_text: greek
perf: TestCharsetEncoderICU
- test_enc: csisolatinhebrew
source_text: hebrew
perf: TestCharsetDecoderICU
- test_enc: csisolatinhebrew
source_text: hebrew
perf: TestCharsetEncoderICU
- test_enc: EUC-JP
source_text: japanese
perf: TestCharsetDecoderICU
- test_enc: EUC-JP
source_text: japanese
perf: TestCharsetEncoderICU
- test_enc: csiso2022jp
source_text: japanese
perf: TestCharsetDecoderICU
- test_enc: csiso2022jp
source_text: japanese
perf: TestCharsetEncoderICU
- test_enc: csiso2022kr
source_text: korean
perf: TestCharsetDecoderICU
- test_enc: csiso2022kr
source_text: korean
perf: TestCharsetEncoderICU
- test_enc: EUC-CN
source_text: s-chinese
perf: TestCharsetDecoderICU
- test_enc: EUC-CN
source_text: s-chinese
perf: TestCharsetEncoderICU
- test_enc: UTF-16BE
source_text: french
perf: TestCharsetDecoderICU
- test_enc: UTF-16BE
source_text: french
perf: TestCharsetEncoderICU
- test_enc: UTF-16LE
source_text: french
perf: TestCharsetDecoderICU
- test_enc: UTF-16LE
source_text: french
perf: TestCharsetEncoderICU
- test_enc: US-ASCII
source_text: english
perf: TestCharsetDecoderICU
- test_enc: US-ASCII
source_text: english
perf: TestCharsetEncoderICU
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run converterperf
env:
DATA_FILE_PATH: data/conversion
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:./target/dependency/*:../main/charset/target/* com.ibm.icu.dev.test.perf.ConverterPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -f $DATA_FILE_PATH/${{ matrix.source_text }}.txt -e UTF-8 -T ${{ matrix.test_enc }} | tee perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for date formatting
icu4j-dateformatperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [TestICUConstruction, TestICUParse, TestICUFormat]
locale: [en_US]
# The parameters don't make for good directory names. Add an identifying digit
# at the end to be used as directory name for the results.
parms: ['"dddd MMM yyyy" "15 Jan 2007" 1', '"HH:mm" "13:13" 2', '"HH:mm zzzz" "13:13 Pacific Standard Time" 3', '"HH:mm z" "13:13 PST" 4', '"HH:mm Z" "13:13 -0800" 5']
include:
- locale: sw_KE
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
perf: TestICUConstruction
- locale: sw_KE
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
perf: TestICUParse
- locale: sw_KE
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
perf: TestICUFormat
permissions:
contents: write
deployments: write
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Extract identifying digit and parameter.
run: |
ddir='${{ matrix.parms }}';
echo "PARM=${ddir:: -2}" >> $GITHUB_ENV;
echo "DDIR=${ddir: -1}" >> $GITHUB_ENV
- name: Build and run dateformatperf
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:./target/dependency/* com.ibm.icu.dev.test.perf.DateFormatPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -L ${{ matrix.locale }} ${{ env.PARM }} -r 1 | tee perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# Retrieve performance test results and upload results to remote repository
perf-test-data-move:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
name: Copy perf data to remote repo for visualization
needs: [icu4c-performance-tests, icu4c-performance-tests-with-files, icu4c-strsrchperf, icu4j-unicodesetperf, icu4j-ucharacterperf, icu4j-decimalformatperf, icu4j-normperf, icu4j-converterperf, icu4j-dateformatperf]
runs-on: ubuntu-22.04 # Updated in BRS
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Switch to benchmark data storage branch.
run: |
git fetch
git checkout perfdata
- name: Publish data
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: unicode-org/icu-perf
publish_branch: main
publish_dir: ./perf
keep_files: true
# Build ICU and tests sample on some windows configurations
icu4c-windows-msvc-postmerge:
runs-on: windows-2022 # Updated in BRS
timeout-minutes: 30
strategy:
matrix:
arch: [x64, x86]
config: [Debug, Release]
include:
- arch: x86
platform: Win32
- arch: x64
platform: x64
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Solution
run: msbuild icu4c/source/allinone/allinone.sln /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
- name: Run Tests (icucheck.bat)
run: icu4c/source/allinone/icucheck.bat ${{ matrix.arch }} ${{ matrix.config }}
- name: Build Sample Solution
run: msbuild icu4c/source/samples/all/all.sln /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.arch }}
- name: Test Samples (samplecheck.bat)
run: icu4c/source/samples/all/samplecheck.bat ${{ matrix.arch }} ${{ matrix.config }}
icu4c-windows-cygwin-gcc:
runs-on: windows-2022 # Updated in BRS
timeout-minutes: 50
env:
ICU_CI_CACHE: c:\icu-ci-cache
CYG_URL: https://cygwin.com/setup-x86_64.exe
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
CYG_PACKAGES: automake,gcc-core,gcc-g++,make,pkg-config,perl,python3
CYG_ROOT: c:\cygwin-root
CYG_CACHE: 'c:\icu-ci-cache\cygwin64-v3'
CYG_CACHED_SETUP: 'c:\icu-ci-cache\cygwin64-v3\setup.exe'
CYG_VERSION_KEY: cygwin-3.2
defaults:
run:
shell: cmd
steps:
- name: Configure Git to checkout with Unix line endings (LF)
run: |
git config --global core.autocrlf input
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Restore Cygwin cache
uses: actions/cache@v4
with:
path: ${{ env.CYG_CACHE }}
key: ${{ hashFiles('.github/workflows/icu_merge_ci.yml') }}
- name: Download Cygwin setup
shell: pwsh
run: |
if ( !(Test-Path "${{ env.CYG_CACHED_SETUP }}" -NewerThan (Get-Date).AddDays(-7)) )
{
Write-Host "Cached Cygwin setup does not exist or is older than 7 days, downloading from external site."
New-Item -Force -Type Directory ${{ env.CYG_CACHE }}
Write-Host "Downloading Cygwin setup..."
$start_time = Get-Date
(New-Object System.Net.WebClient).DownloadFile("${{ env.CYG_URL }}", "${{ env.CYG_CACHED_SETUP }}")
Write-Output "Download took: $((Get-Date).Subtract($start_time).Seconds) second(s)."
}
- name: Install Cygwin
run: |
${{ env.CYG_CACHED_SETUP }} --no-verify --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site "${{ env.CYG_MIRROR }}" --root "${{ env.CYG_ROOT }}" --local-package-dir "${{ env.CYG_CACHE }}" --packages "${{ env.CYG_PACKAGES }}"
- name: Check Cygwin environment
run: |
${{ env.CYG_ROOT }}/bin/sh -lc 'echo Hello' && ${{ env.CYG_ROOT }}/bin/sh -lc 'uname -a'
- name: Build ICU (source and test)
run: |
${{ env.CYG_ROOT }}/bin/bash -lc "cd $(cygpath \"${{ github.workspace }}\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests -j -l4.5"
env:
CC: gcc
CXX: g++
- name: Run Tests
run: |
${{ env.CYG_ROOT }}/bin/bash -lc "cd $(cygpath \"${{ github.workspace }}\") && cd icu4c/source && make -j -l4.5 check"
env:
CC: gcc
CXX: g++