forked from unicode-org/cldr
-
Notifications
You must be signed in to change notification settings - Fork 0
255 lines (253 loc) · 8.53 KB
/
build-icu.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
# Build ICU
name: Build ICU from CLDR
on:
workflow_dispatch:
inputs:
cldr-ref:
description: CLDR ref to build
required: true
default: 'main'
cldr-repo:
description: CLDR repo to build
required: true
default: 'unicode-org/cldr'
icu-repo:
description: ICU repo
required: true
default: 'unicode-org/icu'
icu-ref:
description: ICU branch/tag
required: true
default: 'main'
jobs:
proddata:
name: Build Production Data
runs-on: ubuntu-latest
steps:
- name: Clone CLDR
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.cldr-ref }}
lfs: false
repository: ${{ github.event.inputs.cldr-repo }}
- 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: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile install package --file tools/pom.xml
-DskipTests=true -pl cldr-code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload cldr-code
uses: actions/upload-artifact@v4
with:
name: cldr-code
path: tools/cldr-code/target/cldr-code.jar
- name: Build prod Data
run: |
rm -rf target/cldr-prod
mkdir -p target/cldr-prod/common
mvn -s .github/workflows/mvn-settings.xml -B -DCLDR_DIR=$(pwd) -DCLDR_GITHUB_ANNOTATIONS=true --file=tools/pom.xml -pl cldr-code \
exec:java -Dexec.mainClass=org.unicode.cldr.tool.GenerateProductionData \
-Dexec.args="-d target/cldr-prod/common/"
(cd target/cldr-prod/ && zip -r ../cldr-prod.zip *)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload cldr-prod
uses: actions/upload-artifact@v4
with:
name: cldr-prod
path: target/cldr-prod.zip
genicudata:
name: Generate ICU4C Data
runs-on: ubuntu-latest
needs: proddata
steps:
- name: Download CLDR Production Artifact
id: downloadprod
uses: actions/download-artifact@v4
with:
name: cldr-prod
path: .
- name: Download CLDR tools
id: downloadtools
uses: actions/download-artifact@v4
with:
name: cldr-code
path: cldr-code
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Setup Maven Settings
uses: s4u/[email protected]
with:
servers: |
[{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ github.token }}"
},{
"id": "githubicu",
"username": "${{ github.actor }}",
"password": "${{ github.token }}"
},{
"id": "githubcldr",
"username": "${{ github.actor }}",
"password": "${{ github.token }}"
}]
- name: Create empty CLDR dir, unpack cldr-prod
run: mkdir -p cldr cldr-prod && cd cldr-prod && unzip ../cldr-prod.zip
# Don't actually need CLDR
# - name: Clone CLDR
# uses: actions/checkout@v4
# with:
# ref: ${{ github.event.inputs.cldr-ref }}
# lfs: false
# repository: ${{ github.event.inputs.cldr-repo }}
# path: cldr
- name: Clone ICU
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.icu-repo }}
ref: ${{ github.event.inputs.icu-ref }}
lfs: false # not needed here
path: icu
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('icu/tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install CLDR tools
# TODO: Should not have to do this, see ICU-21425
# Do this after restoring cache.
run: >
mvn -B install:install-file -Dproject.parent.relativePath="" -DgroupId=org.unicode.cldr
-DartifactId=cldr-api -Dversion=0.1-SNAPSHOT -Dpackaging=jar -DgeneratePom=true
-Dfile=cldr-code/cldr-code.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate ICU4C Data
run: >
env
TOOLS_ROOT=$(pwd)/icu/tools/
CLDR_DIR=$(pwd)/cldr
CLDR_DATA_DIR=$(pwd)/cldr-prod/
ant -f icu/tools/cldr/cldr-to-icu/build-icu-data.xml clean all && ln icu/icu4c/LICENSE icu/icu4c/source/data/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Zip up icu-data.zip
run: 'cd icu/icu4c/source && zip -rlq ../../../icu-data.zip data'
- name: Upload icu-data.zip
uses: actions/upload-artifact@v4
with:
name: icu-data
path: icu-data.zip
# 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.)
icu4c-clang:
name: ICU4C Build/Test, Ubuntu/Clang, new data
runs-on: ubuntu-latest
needs: genicudata
steps:
- name: Clone ICU
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.icu-repo }}
ref: ${{ github.event.inputs.icu-ref }}
lfs: false
- name: Download icu-data.zip
uses: actions/download-artifact@v4
with:
name: icu-data
path: .
- name: Unpack icu-data.zip
run: cd icu4c/source && rm -rf data && unzip -o ../../icu-data.zip
- name: ICU4C with clang
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
sudo apt-get -y install doxygen;
cd icu4c/source;
./runConfigureICU Linux;
make -j 2;
make dist
- name: Upload icu4c
uses: actions/upload-artifact@v4
with:
name: icu4c
path: icu4c/source/dist
- name: ICU4C with clang test
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
cd icu4c/source;
make -j 2 check;
( cd test/depstest && python3 depstest.py ../../../source/ );
( cd .. && source/test/hdrtst/testtagsguards.sh );
icu4j-java16:
name: ICU4J Build/Test, Java 16, new data
runs-on: ubuntu-latest
needs: genicudata
steps:
- name: Clone ICU
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.icu-repo }}
ref: ${{ github.event.inputs.icu-ref }}
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Download icu-data.zip
uses: actions/download-artifact@v4
with:
name: icu-data
path: .
- name: Unpack icu-data.zip
run: cd icu4c/source && rm -rf data && unzip -o ../../icu-data.zip
- name: Generate ICU4J data
run: cd icu4c/source && ./runConfigureICU Linux && make -j2 && make -C data icu4j-data-install ICU4J_ROOT=$(cd ../../icu4j ; pwd)
- uses: actions/setup-java@v4
with:
java-version: '16' # For ICU4J
distribution: 'temurin'
- name: ICU4J Build
run: |
cd icu4j;
ant init;
ant jar;
ant releaseBinaries;
- name: Upload icu4j
uses: actions/upload-artifact@v4
with:
name: icu4j
path: icu4j/release
- name: ICU4J Test
run: |
ant check;
ant localespiCheck;
- name: List failures (if any)
run: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
if: ${{ failure() }}