forked from unicode-org/icu4x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
350 lines (305 loc) · 9.68 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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# 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 = "./docs/tutorials/gn/gn.toml"}, #
{ 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"}, #
]
[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"
env = { "ICU4X_DATA_DIR" = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/provider/datagen/tests/data/baked" }
run_task.name = [
"ci-job-fmt",
"ci-job-clippy",
"check-no-features",
"depcheck",
"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-gigo]
description = "Run specific tests with debug assertions disabled"
category = "CI"
dependencies = [
"test-dev-without-assertions",
]
[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-npm",
"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",
"check-no-features",
"depcheck",
"ci-job-doc",
# not so quick
"ci-job-diplomat",
"ci-job-tidy",
"ci-job-nostd",
"ci-job-msrv-check",
"check-tutorials-local",
# Get a coffee
"ci-job-test",
"ci-job-test-docs",
"ci-job-test-tutorials-cratesio",
"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_override = set false
override_channel = set "nightly"
# We need to parse the channel information for dispatch/schedule events
if eq "${event_name}" "workflow_dispatch" or eq "${event_name}" "schedule"
event_path = get_env GITHUB_EVENT_PATH
event_file = readfile ${event_path}
event_json = json_parse ${event_file}
# For dispatch events
if eq "${event_name}" "workflow_dispatch"
if not eq "${event_json.inputs.channel}" "pinned-stable"
needs_override = set true
override_channel = set "${event_json.inputs.channel}"
end
else
# Schedule events always override
needs_override = set true
# For schedule events, the cronjob on minute 1 is the beta job
if eq "${event_json.schedule}" "1 14 * * *"
override_channel = set "beta"
end
end
end
if ${needs_override}
echo "Setting up CI environment for forced-${override_channel} Rust build"
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 ${override_channel}
if starts_with "${override_channel}" "nightly"
# This affects tasks that can only be built on nightly
appendfile ${env_file} "ICU4X_NIGHTLY_TOOLCHAIN=${override_channel}\n"
end
else
echo "forced-nightly environment not required"
end
'''