forked from unicode-org/icu4x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
329 lines (287 loc) · 8.89 KB
/
Makefile.toml
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
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
extend = [
{ path = "./tools/make/data.toml"}, #
{ path = "./tools/make/valgrind.toml"}, #
{ path = "./tools/make/tidy.toml"}, #
{ path = "./tools/make/wasm.toml"}, #
{ path = "./tools/make/tests.toml"}, #
{ path = "./tools/make/ffi.toml"}, #
{ path = "./tools/make/gn.toml"}, #
]
[config]
default_to_workspace = false
[env]
ICU4X_NIGHTLY_TOOLCHAIN = { value = "nightly-2022-12-26", condition = { env_not_set = ["ICU4X_NIGHTLY_TOOLCHAIN"] } }
# To install a specific build of GN, set the ICU4X_GN_PACKAGE environment variable. Choices:
# https://chrome-infra-packages.appspot.com/p/gn/gn
# TODO: Choose the correct distribution of GN automatically.
ICU4X_GN_PACKAGE = { value = "gn/gn/linux-amd64", condition = { env_not_set = ["ICU4X_GN_PACKAGE"] } }
ICU4X_BUILDING_WITH_FORCED_NIGHTLY = { value = "1", condition = { env_set = ["ICU4X_BUILDING_WITH_FORCED_NIGHTLY"] } }
[tasks.quick]
description = "Run quick version of all lints and builds (useful before pushing to GitHub)"
category = "ICU4X Development"
dependencies = [
"ci-job-fmt",
"ci-job-clippy",
"ci-job-nostd",
"check-no-features",
"check-tutorials-local",
"ci-job-tidy",
"ci-job-doc",
]
[tasks.tidy]
description = "Run fmt and other tidy checks"
category = "ICU4X Development"
dependencies = [
"ci-job-fmt",
"ci-job-tidy",
]
[tasks.check]
description = "Check ICU4X build with no features (covered in CI via cargo make check-all-features)"
category = "ICU4X Development"
command = "cargo"
args = ["check", "--all-targets", "--all-features"]
[tasks.check-no-features]
description = "Check ICU4X build with no features (covered in CI via cargo make check-all-features)"
category = "ICU4X Development"
command = "cargo"
args = ["check", "--no-default-features"]
[tasks.ci-job-msrv-check]
description = "Run all tests for the CI 'check' job"
category = "ICU4X Development"
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.67 --profile minimal
exec --fail-on-error cargo +1.67 check --all-targets --all-features
'''
[tasks.ci-job-test]
description = "Run all tests for the CI 'test' job"
category = "CI"
dependencies = [
"test-all-features",
]
[tasks.ci-job-test-windows]
description = "Run all tests for the CI 'test' job (with special changes to reduce Windows disk space)"
category = "CI"
dependencies = [
"test-all-features-windows",
]
[tasks.ci-job-test-tutorials-local]
description = "Run all checks for the CI 'test-tutorials' job"
category = "CI"
dependencies = [
"test-tutorials-local",
]
[tasks.ci-job-test-tutorials-cratesio]
description = "Run all checks for the CI 'test-tutorials' job"
category = "CI"
dependencies = [
"test-tutorials-cratesio",
]
[tasks.ci-job-testdata]
description = "Run all tests for the CI 'testdata' job"
category = "CI"
dependencies = [
"testdata-check",
]
[tasks.ci-job-testdata-legacy]
description = "Run all tests for the CI 'testdata' job"
category = "CI"
dependencies = [
"testdata-legacy",
"testdata-legacy-test",
]
[tasks.ci-job-test-docs]
description = "Run all tests for the CI 'test-docs' job"
category = "CI"
dependencies = [
"test-docs",
]
[tasks.ci-job-full-datagen]
description = "Run full data generation on latest CLDR and ICU"
category = "CI"
dependencies = [
"bakeddata-check",
]
[tasks.ci-job-test-c]
description = "Run all tests for the CI 'test-c' job"
category = "CI"
dependencies = [
"test-c",
"test-c-tiny",
"test-cpp",
]
[tasks.ci-job-test-js]
description = "Run all tests for the CI 'test-js' job"
category = "CI"
dependencies = [
"test-js",
"test-tinywasm",
]
[tasks.ci-job-test-dart]
description = "Run all tests for the CI 'test-dart' job"
category = "CI"
dependencies = [
"test-dart",
]
[tasks.ci-job-nostd]
description = "Run all tests for the CI 'test-nostd' job"
category = "CI"
dependencies = [
"check-nostd",
"check-freertos-wearos",
]
[tasks.ci-job-diplomat]
description = "Run all tests for the CI 'diplomat' job"
category = "CI"
dependencies = [
"verify-diplomat-gen",
"verify-diplomat-coverage",
]
[tasks.ci-job-gn]
description = "Run all tests for the CI 'gn' job"
category = "CI"
dependencies = [
"verify-gn-gen",
"gn-run",
]
[tasks.ci-job-msrv-features-1]
description = "Run all tests for the CI 'msrv-features-1' job"
category = "CI"
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.67 --profile minimal
exec --fail-on-error cargo +1.67 make check-all-features-chunked 1
'''
[tasks.ci-job-msrv-features-2]
description = "Run all tests for the CI 'msrv-features-2' job"
category = "CI"
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.67 --profile minimal
exec --fail-on-error cargo +1.67 make check-all-features-chunked 2
'''
[tasks.ci-job-msrv-features-3]
description = "Run all tests for the CI 'msrv-features-3' job"
category = "CI"
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.67 --profile minimal
exec --fail-on-error cargo +1.67 make check-all-features-chunked 3
'''
[tasks.ci-job-msrv-features]
description = "Run all tests for the CI 'msrv-features-3' job"
category = "CI"
dependencies = [
"ci-job-msrv-features-1",
"ci-job-msrv-features-2",
"ci-job-msrv-features-3",
]
[tasks.ci-job-fmt]
description = "Run all tests for the CI 'fmt' job"
category = "CI"
dependencies = [
"fmt-check",
]
[tasks.ci-job-tidy]
description = "Run all tests for the CI 'tidy' job"
category = "CI"
dependencies = [
"license-header-check",
"generated-readme-check",
"license-file-check",
"depcheck",
]
[tasks.ci-job-clippy]
description = "Run all tests for the CI 'clippy' job"
category = "CI"
dependencies = [
"clippy-all",
]
[tasks.ci-job-doc]
description = "Runs rustdoc generation for the CI 'doc' job"
category = "CI"
env = { RUSTDOCFLAGS = "-Dwarnings" }
command = "cargo"
args = ["doc", "--workspace", "--release", "--all-features", "--no-deps", "--lib"]
[tasks.ci-all]
# Note that updating this list will not update what is run on CI,
# it simply exists as a shortcut to run everything locally
description = "Locally run all CI jobs"
category = "ICU4X Development"
dependencies = [
# make quick
"ci-job-fmt",
"ci-job-clippy",
"ci-job-nostd",
"ci-job-msrv-check",
"check-tutorials-local",
"ci-job-tidy",
"ci-job-doc",
# Get a coffee
"ci-job-test",
"ci-job-test-docs",
"ci-job-check-tutorials-cratesio",
"ci-job-diplomat",
"ci-job-testdata",
"ci-job-msrv-features",
"ci-job-full-datagen",
# Needs tools other than Cargo to be installed
"ci-job-test-c",
"ci-job-test-js",
"ci-job-test-dart",
"ci-job-gn",
# benchmarking and coverage jobs not included
]
[tasks.install-nightly]
description = "Installs $ICU4X_NIGHTLY_TOOLCHAIN"
category = "ICU4X Development"
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install ${ICU4X_NIGHTLY_TOOLCHAIN} --profile minimal
exec --fail-on-error rustup component add rust-src --toolchain ${ICU4X_NIGHTLY_TOOLCHAIN}
'''
# For the nightly CI, we set three environment variables, and set a rustup override to nightly.
# Each env var has a different purpose:
# - ICU4X_NIGHTLY_TOOLCHAIN: This overrides the nightly used by this makefile
# - ICU4X_BUILDING_WITH_FORCED_NIGHTLY: This lets tests know that we're building with forced nightly, in case of tests testing the behavior of specific Rust versions.
# - `RUSTDOCFLAGS=--cfg ICU4X_BUILDING_WITH_FORCED_NIGHTLY`: Same as previously, but works for disabling doctests. Use ICU4X_BUILDING_WITH_FORCED_NIGHTLY where possible.
#
# When updating the toolchain, please audit all cases of ICU4X_BUILDING_WITH_FORCED_NIGHTLY and remove cfgs where necessary.
[tasks.set-nightly-version-for-ci]
description = "Set all nightly version env vars for CI"
category = "CI"
script_runner = "@duckscript"
script = '''
exit_on_error true
env_file = get_env GITHUB_ENV
if not ${env_file}
echo "GITHUB_ENV not set!"
exit 1
end
event_name = get_env GITHUB_EVENT_NAME
if not ${event_name}
echo "GITHUB_EVENT_NAME not set!"
exit 1
end
needs_nightly = eq "${event_name}" "schedule"
if eq "${event_name}" "workflow_dispatch"
event_path = get_env GITHUB_EVENT_PATH
event_file = readfile ${event_path}
event_json = json_parse ${event_file}
if ${event_json.inputs.nightly}
needs_nightly = set true
end
end
if ${needs_nightly}
echo "Setting up CI environment for forced-nightly Rust build"
appendfile ${env_file} "ICU4X_NIGHTLY_TOOLCHAIN=nightly\n"
appendfile ${env_file} "ICU4X_BUILDING_WITH_FORCED_NIGHTLY=1\n"
appendfile ${env_file} "RUSTDOCFLAGS=--cfg ICU4X_BUILDING_WITH_FORCED_NIGHTLY\n"
exec rustup override set nightly
else
echo "forced-nightly environment not required"
end
'''