-
-
Notifications
You must be signed in to change notification settings - Fork 742
938 lines (884 loc) · 35.9 KB
/
icu4c.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
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks.
name: GHA ICU4C
on:
push:
branches:
- main
- 'maint/maint*'
paths:
- 'icu4c/**'
- 'testdata/**'
- '.github/workflows/**'
pull_request:
branches: '**'
paths:
- 'icu4c/**'
- 'testdata/**'
- '.github/workflows/**'
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
inputs:
gitReleaseTag:
description: 'Release tag to upload to. Must start with "release-"'
type: string
# 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' }}
permissions:
contents: read
jobs:
# ICU4C docs build using doxygen..
icu4c-docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C doc
run: |
sudo apt-get -y install doxygen;
cd icu4c/source;
./runConfigureICU Linux --disable-renaming;
# Fail if 'warning:' appears in doxygen's output, but ignore warnings from file Doxyfile.
# Regex note: (?! ... ) is a negative lookahead. Succeed if the pattern is not present.
set +o pipefail && make doc 2>&1 | tee doxygen.log && ( ! grep -P 'warning:(?! .* file .?Doxyfile)' doxygen.log )
# gcc debug build.
# Includes dependency checker.
# Note - the dependency checker needs to be run on both a debug and an optimized build.
# This one (gcc) for debug, and linux clang (see job below) for optimized.
#
# Test both out-of-source and in-source builds. This one (gcc) for out-of-source,
# and linux clang (below) for in-source.
#
# Invokes test/hdrtst to check public headers compliance.
gcc-debug-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with gcc
env:
PREFIX: /tmp/icu-prefix
run: |
mkdir build;
cd build;
../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/gcc --prefix=$PREFIX --enable-tracing;
make -j -l4.5 check;
( cd ../icu4c/source/test/depstest && ./depstest.py ../../../../build/ );
make install;
PATH=$PREFIX/bin:$PATH make -C test/hdrtst check
#gcc 11 with c++ 20
gcc11-cpp20:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install GCC-11
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-11 g++-11
- name: Build and Test
env:
CC: gcc-11
CXX: g++-11
CXXFLAGS: -std=c++20 -fext-numeric-literals
run: |
cd icu4c/source;
./runConfigureICU Linux
make -j -l4.5 check;
# clang release build with some options to enforce useful constraints.
# Includes dependency checker on an in-source, optimized build.
# Includes checking @draft etc. API tags vs. ifndef guards like
# U_HIDE_DRAFT_API and U_FORCE_HIDE_DRAFT_API.
# (FORCE guards make this tool pass but won't compile to working code.
# See the testtagsguards.sh script for details.)
clang-release-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install doxygen
run: |
sudo apt-get -y install doxygen;
- name: Build ICU4C with clang
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
cd icu4c/source;
./runConfigureICU Linux/clang;
make -j -l4.5 check;
- name: Test Dependency
run: |
cd icu4c/source/test/depstest;
python3 depstest.py ../../../source/;
- name: Test Tags Guards
run: |
cd icu4c;
source/test/hdrtst/testtagsguards.sh;
- name: Test C Default locale
run: |
cd icu4c/source/test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
- name: Test C.UTF-8 Default locale
run: |
cd icu4c/source/test/cintltst && LANG=C.UTF-8 LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
- name: Make Dist
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
cd icu4c/source;
make dist
# clang build with some options
clang-options-build-and-test:
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other options.
fail-fast: false
matrix:
build_option:
[ --enable-static, --enable-static --disable-shared ]
# --disable-shared has a build problem.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build ICU4C with clang
run: |
cd icu4c/source;
./runConfigureICU Linux/clang ${{ matrix.build_option }};
make -j -l4.5 tests;
- name: Test
run: |
cd icu4c/source;
make check;
# Out of source build with gcc 10, c++14, and extra warnings; executes icuinfo.
gcc-10-stdlib17:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with gcc 10 and c++17 and extra warnings.
env:
PREFIX: /tmp/icu-prefix
CC: gcc-10
CXX: g++-10
CXXFLAGS: -std=c++17 -Wextra
run: |
mkdir build;
cd build;
../icu4c/source/runConfigureICU Linux --disable-layout --disable-layoutex --prefix=$PREFIX;
make -j -l4.5 check;
make -j -l4.5 install;
cd $PREFIX/bin;
LD_LIBRARY_PATH=../lib ./icuinfo
# Clang Linux with address sanitizer.
clang-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and asan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming --enable-tracing;
make -j -l4.5 check;
env:
CPPFLAGS: -fsanitize=address
LDFLAGS: -fsanitize=address
# Clang Linux with leak sanitizer.
clang-lsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and lsan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming --enable-tracing;
make -j -l4.5 check;
env:
CPPFLAGS: -fsanitize=leak
LDFLAGS: -fsanitize=leak
ASAN_OPTIONS: detect_leaks=1
# Clang Linux with undefined-behavior sanitizer.
clang-ubsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and ubsan +alignment
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming;
make -j -l4.5 check;
env:
CPPFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
CFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
LDFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
# Control Flow Integrity.
clang-cfi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang using CFI
run: |
cd icu4c/source;
./runConfigureICU Linux --disable-renaming;
make -j -l4.5 check;
env:
CC: clang
CXX: clang++
# add -fsanitize=cfi-vcall -fsanitize=cfi-icall later
CXXFLAGS: -flto -fvisibility=hidden -fsanitize=cfi-derived-cast -fno-sanitize-trap=cfi -fno-inline-functions -fno-inline -fno-omit-frame-pointer -O1
# add -fsanitize=cfi-vcall -fsanitize=cfi-icall later
LDFLAGS: -flto -fvisibility=hidden -fuse-ld=gold -fsanitize=cfi-derived-cast -fsanitize=cfi-unrelated-cast -fno-sanitize-trap=cfi -fsanitize-cfi-icall-generalize-pointers
# Clang Linux with thread sanitizer.
clang-tsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and tsan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming
make -j -l4.5;
make -j -l4.5 -C test;
make -j -l4.5 -C test/intltest check
env:
INTLTEST_OPTS: utility/MultithreadTest
CPPFLAGS: -fsanitize=thread
LDFLAGS: -fsanitize=thread
#------------------------------------------------------
# Clang Linux with data filter
# Note: This job uses `make -j2` instead of `make -j -l4.5` because with more parallelism (PR #2456)
# this check became flaky. The build apparently was not done copying one or another .ucm file before
# calling makeconv for it, although the Makefile has appropriate dependencies.
clang-datafilter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Extract ICU version
run: |
# Extract ICU version from icuver.txt
icuverContent=$(cat icu4c/source/data/misc/icuver.txt)
icuVersion=$(echo "$icuverContent" | grep -oP 'ICUVersion\{"\K\d+\.\d+\.\d+\.\d+')
majorVersion=$(echo "$icuVersion" | cut -d. -f1)
echo "majorVersion=$majorVersion"
echo "majorVersion=$majorVersion" >> $GITHUB_ENV
- name: Build ICU4C with clang
run: |
cd icu4c/source && \
ICU_DATA_FILTER_FILE=../../.github/data-filter.json ./runConfigureICU Linux/clang && \
make -j2 tests && \
\[ ! -d data/out/build/icudt${majorVersion}l/translit \] && \
(cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest translit/TransliteratorTest/TestBasicTransliteratorEvenWithoutData) && \
(cd test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestEnglishExemplarCharacters /tsutil/cldrtest/TestCoverage)
# Clang Linux with CPP 17
clang-cpp17:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build ICU4C with CPP 17
env:
CXXFLAGS: -std=c++17 -Winvalid-constexpr
run: |
cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux/clang && make -j -l4.5 check
# Clang Linux with LANG: en_US@calendar=gregorian;hours=h12
clang-lang-with-extn-tags:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Linux Clang - LANG has extension tags
env:
LANG: "en_US@calendar=gregorian;hours=h12"
run: |
cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux/clang && make -j -l4.5 check
# Clang Linux 18 with CPP20 and treat warnings as errors
clang18-cpp20-warning-as-errors:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flags:
- '-std=c++20'
- '-std=c++20 -stdlib=libc++'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Clang-18
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 18 all
- name: Clang-18 build and Test
env:
CC: clang-18
CXX: clang++-18
CPPFLAGS: '-Wall -Wextra -Wctad-maybe-unsupported -Werror'
CXXFLAGS: ${{ matrix.flags }}
run: |
cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j -l4.5 check
# MacOS with clang
macos-clang:
runs-on: macos-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang on MacOS
env:
CPPFLAGS: '-Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor -Wctad-maybe-unsupported -Werror'
run: |
cd icu4c/source;
PYTHON=python3 ./runConfigureICU macOS;
make -j -l4.5 check
# Windows MSVC builds
windows-msvc:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- test_flags: 'x64 Debug'
build_flags: '/p:Configuration=Debug /p:Platform=x64'
- test_flags: 'x86 Debug'
build_flags: '/p:Configuration=Debug /p:Platform=Win32'
- test_flags: 'arm Release'
build_flags: '/p:Configuration=Release /p:Platform=ARM'
- test_flags: 'x64 Release'
build_flags: '/p:LanguageStandard=stdcpplatest /p:Configuration=Release /p:Platform=x64'
- test_flags: 'x64 Release'
build_flags: '/p:_HAS_EXCEPTIONS=0 /p:Configuration=Release /p:Platform=x64'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Solution x64
if: contains(matrix.test_flags, 'arm Release')
run: msbuild icu4c/source/allinone/allinone.sln /p:Configuration=Release /p:Platform=x64
- name: Build Solution
run: |
msbuild icu4c/source/allinone/allinone.sln ${{ matrix.build_flags }}
- name: Run ${{ matrix.test_flags }} Tests (icucheck.bat)
if: contains(matrix.test_flags, 'arm Release') == false
run: |
icu4c\source\allinone\icucheck.bat ${{ matrix.test_flags }}
# Windows data filter build
windows-msvc-datafilter:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set ICU_DATA_FILTER_FILE variable
run: |
$filterPath = "${{ github.workspace }}\.github\data-filter.json"
echo "ICU_DATA_FILTER_FILE=$filterPath" >> $GITHUB_ENV
shell: pwsh
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Solution with Data Filter
run: msbuild icu4c/source/allinone/allinone.sln /p:Configuration=Release /p:Platform=x64 /p:SkipUWP=true
# Windows MSVC distribution release
windows-msvc-dist-release:
runs-on: windows-latest
permissions:
contents: write # So that we can upload to release
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- arch: 'x64'
plat: 'x64'
win_ver: 'Win64'
- arch: 'x86'
plat: 'Win32'
win_ver: 'Win32'
- arch: 'arm64'
plat: 'ARM64'
win_ver: 'WinARM64'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Solution x64
if: contains(matrix.win_ver, 'ARM64')
run: msbuild icu4c/source/allinone/allinone.sln /p:Configuration=Release /p:Platform=x64
- name: Build Solution
run: msbuild icu4c/source/allinone/allinone.sln /p:Configuration=Release /p:Platform=${{ matrix.plat }}
- name: Run Tests (icucheck.bat)
if: contains(matrix.win_ver, 'ARM64') == false
run: icu4c/source/allinone/icucheck.bat ${{ matrix.arch }} Release
- name: "Run PowerShell: Distrelease script (${{ matrix.arch }})"
run: |
cd ./icu4c/
./packaging/distrelease.ps1 -arch ${{ matrix.arch }}
shell: pwsh
- name: Extract ICU version and rename zip file
id: set-zip-name
run: |
# Extract ICU version from icuver.txt
$icuverContent = Get-Content icu4c\source\data\misc\icuver.txt
$icuVersion = ($icuverContent -match 'ICUVersion{"(\d+\.\d+\.\d+\.\d+)"}')[0]
$icuVersion -match '\{"(.*?)"\}' | Out-Null
$icuVersion = $matches[1]
$majorVersion = $icuVersion.Split('.')[0]
$minorVersion = $icuVersion.Split('.')[1]
# Determine the new file name based on the version
if ($minorVersion -eq "0") {
$newZipName = "icu4c-${majorVersion}rc-${{ matrix.win_ver }}-MSVC2022"
} else {
$newZipName = "icu4c-${majorVersion}_${minorVersion}-${{ matrix.win_ver }}-MSVC2022"
}
# Debugging: Print the new zip name
Write-Host "New Zip Name: $newZipName"
# Rename the existing zip file
cd icu4c\source\dist\ && ls -l .
Rename-Item -Path icu-windows.zip -NewName "${newZipName}.zip"
echo $newZipName
ls -l .
echo "newZipName=$newZipName" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: icu4c.${{ matrix.win_ver }}.run_#${{ github.run_number }}
path: icu4c/source/dist/${{ env.newZipName }}.zip
- name: Upload to release
if: ${{ inputs.gitReleaseTag && startsWith(inputs.gitReleaseTag, 'release-') }}
run: |
gh release upload ${{ inputs.gitReleaseTag }} icu4c/source/dist/${{ env.newZipName }}.zip --clobber
env:
GH_TOKEN: ${{ github.token }}
# Window MSYS2 tests
windows-msys2-gcc-x86_64:
runs-on: windows-latest
timeout-minutes: 45
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
id: msys2
with:
update: true
msystem: mingw64
install: >
base-devel
mingw-w64-x86_64-toolchain
make
- name: 'Verify MinGW Installation'
run: gcc --version
- name: Build and Test
run: |
cd '${{ github.workspace }}' && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j -l4.5 check
- name: Make install
run: |
cd '${{ github.workspace }}' && cd icu4c/source && make install && cd /tmp/build-icu && echo 'Recursive ls' && ls -lR
- name: Run icuinfo
run: |
echo 'Run icuinfo from MSYS shell' && cd /tmp/build-icu/bin && ./icuinfo.exe
- name: Run icuinfo from CMD
shell: cmd
run: |
cd /d ${{ steps.msys2.outputs.msys2-location }}\tmp\build-icu\bin
set PATH=C:\tools\msys64\mingw64\bin;%PATH%
.\icuinfo.exe
# Run ICU4C tests with stubdata.
run-with-stubdata:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C tests with stubdata
run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j -l4.5 check;
rm lib/libicudata.so*;
cp -P stubdata/libicudata.so* lib;
cd test/cintltst;
echo 'Running ICU4C cintltst with stubdata.';
# Note: 'Elapsed Time: ' is printed by makefile upon final success.
CINTLTST_OPTS=-w make -j -l4.5 check 2>&1 | tee stubdata_ctest.log;
if ! grep 'Elapsed Time: ' stubdata_ctest.log
then
echo
echo cintltst run with stubdata failed
echo
echo See
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
echo for how to reproduce and debug the failure
exit 1
fi
cd ../intltest;
echo 'Running ICU4C intltest with stubdata.';
INTLTEST_OPTS=-w make -j -l4.5 check 2>&1 | tee stubdata_intltest.log;
if ! grep 'Elapsed Time: ' stubdata_intltest.log
then
echo
echo intltest run with stubdata failed
echo
echo See
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
echo for how to reproduce and debug the failure
exit 1
fi
# Test U_CHARSET_IS_UTF8
u-charset-is-utf8-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1";
make -j -l4.5 check
# Test U_OVERRIDE_CXX_ALLOCATION-is-0-test
u-override-cxx-allocation-is-0-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
./runConfigureICU Linux CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0";
make clean;
make -j -l4.5 check
# Test LSTM
lstm-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j -l4.5 check
# Test adaboost
adaboost-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j -l4.5 check
# Build and run testmap
testmap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j -l4.5 check;
CONFIG_FILES=test/testmap/Makefile ./config.status;
cd test/testmap;
make -j -l4.5 check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
# Copyright scan
copyright-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: perl tools/scripts/cpysearch/cpyscan.pl
# Check compilation of internal headers.
internal-header-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: cd icu4c/source; test/hdrtst/testinternalheaders.sh
# Check source files for valid UTF-8 and for absence of BOM.
valid-UTF-8-and-no-BOM-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: tools/scripts/icu-file-utf8-check.py
# Run unit tests with UCONFIG_NO_XXX variations.
uconfig-unit-tests:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other uconfig.
fail-fast: false
matrix:
uconfig_cppflags:
# Ignore the following two.
# - "-DUCONFIG_NO_FILE_IO=1"
# - "-DUCONFIG_NO_CONVERSION=1"
- "-DUCONFIG_NO_LEGACY_CONVERSION=1"
- "-DUCONFIG_NO_NORMALIZATION=1"
- "-DUCONFIG_NO_BREAK_ITERATION=1"
- "-DUCONFIG_NO_IDNA=1"
- "-DUCONFIG_NO_COLLATION=1"
- "-DUCONFIG_NO_FORMATTING=1"
- "-DUCONFIG_NO_MF2=1"
- "-DUCONFIG_NO_TRANSLITERATION=1"
- "-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
- "-DUCONFIG_NO_SERVICE=1"
- "-DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
# Turn on all the options in one test.
- "-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Verify no additional new UCONFIG_NO_xxx added
run: |
# Test that we have exactly 13 "#ifndef UCONFIG_NO_" in uconfig.h. If the number changes, we need to also
# adjust the uconfig_cppflags above to include the new one and update the "13" below.
expected_count="13";
count=`egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h| wc -l`;
if [ $expected_count != $count ]; then
echo "More than %s UCONFIG_NO_* defined in uconfig.h, please adjust uconfig_cppflags above to include any newly added flag" % $expected_count;
echo "Currently UCONFIG_NO_* defined in uconfig.h:";
egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h;
exit -1
fi
- name: Build and Test
env:
CPPFLAGS: ${{ matrix.uconfig_cppflags }}
run: |
cd icu4c/source/;
./runConfigureICU Linux;
make -j -l4.5 tests;
# Run header tests with UCONFIG_NO_XXX variations.
uconfig-header-tests:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other uconfig.
fail-fast: false
matrix:
uconfig_cppflags:
# Ignore the following two.
# - "-DUCONFIG_NO_FILE_IO=1"
# - "-DUCONFIG_NO_CONVERSION=1"
- "-DUCONFIG_NO_LEGACY_CONVERSION=1"
- "-DUCONFIG_NO_NORMALIZATION=1"
- "-DUCONFIG_NO_BREAK_ITERATION=1"
- "-DUCONFIG_NO_IDNA=1"
- "-DUCONFIG_NO_COLLATION=1"
- "-DUCONFIG_NO_FORMATTING=1"
- "-DUCONFIG_NO_MF2=1"
- "-DUCONFIG_NO_TRANSLITERATION=1"
- "-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
- "-DUCONFIG_NO_SERVICE=1"
- "-DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
# Turn on all the options in one test.
- "-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Verify no additional new UCONFIG_NO_xxx added
run: |
# Test that we have exactly 13 "#ifndef UCONFIG_NO_" in uconfig.h. If the number changes, we need to also
# adjust the uconfig_cppflags above to include the new one and update the "13" below.
count=`egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h| wc -l`;
if [ "13" != $count ]; then
echo "More than %s UCONFIG_NO_* defined in uconfig.h, please adjust uconfig_cppflags above to include any newly added flag" % $count;
echo "Currently UCONFIG_NO_* defined in uconfig.h:";
egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h;
exit -1
fi
- name: Build and Install
run: |
cd icu4c/source/;
mkdir /tmp/icu_cnfg;
./runConfigureICU Linux --prefix=/tmp/icu_cnfg;
make -j -l4.5 install;
- name: Test
env:
UCONFIG_NO: ${{ matrix.uconfig_cppflags }}
run: |
cd icu4c/source/;
PATH=/tmp/icu_cnfg/bin:$PATH make -C test/hdrtst check;
# Build Unicode update tools
unicode-update-tools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0
- name: Get CI Linux runner VM version
id: linux-version
run: |
echo "LINUX_VERSION=$(grep -F VERSION_ID /etc/os-release | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- name: Mount bazel cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: "~/.cache/bazel"
key: bazel-${{ runner.os }}-${{ steps.linux-version.outputs.LINUX_VERSION }}
- name: Generate the data
run: |
export ICU_SRC=`pwd`;
icu4c/source/data/unidata/generate.sh;
if $?
then
echo
echo Build of Unicode update tools failed.
echo See
echo https://unicode-org.github.io/icu/processes/unicode-update#bazel-build-process
echo for how to reproduce and debug the failure
exit 1
fi
git diff --exit-code;
if $?
then
echo
echo ICU unicode data has changed!
echo Did you forget to include the changed data files in this PR?
exit 1
fi
# Build and run ICU4C samples
icu4c-test-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C configure and build
run: |
# Perform an out-of-source build of icu4c
mkdir /tmp/icu_samples
cd icu4c/source
./runConfigureICU Linux -prefix=/tmp/icu_samples
make install
# Reference the paths in the new build
cd samples
# To clean all the test binaries
make clean-samples-recursive
# To rebuild them all
echo "Make all samples"
PATH=$PATH:/tmp/icu_samples/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/icu_samples/lib make all-samples-recursive
# To run all tests serially
echo "Run all samples"
pwd
PATH=$PATH:/tmp/icu_samples/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/icu_samples/lib make check-samples-recursive
# https://unicode-org.github.io/icu/processes/release/tasks/integration.html#verify-that-icu4c-tests-pass-without-collation-rule-strings
icu4c-without-collation-rule-strings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install hjson dependency
run: |
sudo apt-get install python3-pip
pip3 install hjson
- name: Create data filter file to remove collation rule strings
run: |
cat > icu4c/coll-norules.hjson <<EOL
{
resourceFilters: [
{
categories: [
coll_tree
]
rules: [
-/UCARules
-/collations/*/Sequence
]
}
]
}
EOL
- name: Configure ICU4C with the data filter file
env:
ICU_DATA_FILTER_FILE: ../coll-norules.hjson
run: |
cd icu4c/source
./runConfigureICU Linux
- name: Run tests with data-errors-as-warnings
env:
INTLTEST_OPTS: -w
CINTLTST_OPTS: -w
run: |
cd icu4c/source
make -j -l4.5 check
# https://unicode-org.github.io/icu/processes/release/tasks/healthy-code.html#test-uconfig_no_conversion
icu4c-uconfig-no-conversion:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set UCONFIG_NO_CONVERSION and configure ICU4C
env:
UCONFIG_NO_CONVERSION: 1
run: |
cd icu4c/source
./runConfigureICU Linux
- name: Run make for stubdata, common, i18n
run: |
cd icu4c/source
pushd stubdata && make -j -l4.5 && popd
# Ensure lib directory for output object file exists
mkdir -p lib
pushd common && make -j -l4.5 && popd
pushd i18n && make -j -l4.5 && popd
# Workflow for ICU Export Data for ICU4X
icu4c-icuexportdata:
runs-on: ubuntu-latest
permissions:
contents: write # So that we can upload to release
timeout-minutes: 30
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build
run: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l4.5
env:
CC: clang
CXX: clang++
- name: Build property data files
run: |
cd icu4c/source
mkdir -p icuexportdata/uprops/fast
./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/fast --trie-type fast --all
mkdir -p icuexportdata/uprops/small
./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/small --trie-type small --all
env:
LD_LIBRARY_PATH: lib
- name: Build normalization data files
run: |
cd icu4c/source
mkdir -p icuexportdata/norm/fast
./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/fast --trie-type fast --all
mkdir -p icuexportdata/norm/small
./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/small --trie-type small --all
env:
LD_LIBRARY_PATH: lib
- name: Build case data files
run: |
cd icu4c/source
mkdir -p icuexportdata/ucase/fast
./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/fast --trie-type fast --all
mkdir -p icuexportdata/ucase/small
./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/small --trie-type small --all
env:
LD_LIBRARY_PATH: lib
- name: Build collation data files
run: |
cd icu4c/source
cd data/coll
FILES=$(ls *.txt)
cd ../../
mkdir -p icuexportdata/collation/unihan
./bin/genrb -X -s data/coll --ucadata data/in/coll/ucadata-unihan-icu4x.icu -d icuexportdata/collation/unihan $FILES
rm icuexportdata/collation/unihan/*.res
mkdir -p icuexportdata/collation/implicithan
./bin/genrb -X -s data/coll --ucadata data/in/coll/ucadata-implicithan-icu4x.icu -d icuexportdata/collation/implicithan $FILES
rm icuexportdata/collation/implicithan/*.res
env:
LD_LIBRARY_PATH: lib
- name: Build segmenter dictionary files
run: |
cd icu4c/source
mkdir -p icuexportdata/segmenter/dictionary
for FILE in $(ls data/brkitr/dictionaries | xargs -n 1 basename); do
./bin/gendict --uchars --toml data/brkitr/dictionaries/$FILE icuexportdata/segmenter/dictionary/$(basename $FILE .txt).toml
done
env:
LD_LIBRARY_PATH: lib
- name: Zip
run: |
cd icu4c/source/icuexportdata
zip -r ../../../icuexportdata_${{ inputs.gitReleaseTag }}.zip .
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: icuexportdata_output
path: icuexportdata_*.zip
- name: Upload to release
if: ${{ inputs.gitReleaseTag && startsWith(inputs.gitReleaseTag, 'release-') }}
run: |
gh release upload ${{ inputs.gitReleaseTag }} icuexportdata_*.zip --clobber
env:
GH_TOKEN: ${{ github.token }}