-
Notifications
You must be signed in to change notification settings - Fork 178
/
Makefile.toml
345 lines (300 loc) · 9.13 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
# 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 = "./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]
# The toolchain that CI is being run in. Allows tests to change under beta/nightly.
CI_TOOLCHAIN = { value = "pinned-stable", condition = { env_not_set = ["CI_TOOLCHAIN"]}}
# The pinned nightly toolchain for jobs that require a nightly compiler.
PINNED_CI_NIGHTLY = { value = "nightly-2024-07-23", condition = { env_not_set = ["PINNED_CI_NIGHTLY"] } }
[tasks.quick]
description = "Run quick version of all lints and builds (useful before pushing to GitHub)"
category = "ICU4X Development"
env = { "ICU4X_DATA_DIR" = "../stubdata" }
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"
env = { ICU4X_DATA_DIR = "../stubdata" }
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"
env = { ICU4X_DATA_DIR = "../stubdata" }
command = "cargo"
args = ["check", "--no-default-features"]
[tasks.ci-job-msrv-check]
description = "Run all tests for the CI 'check' job"
category = "ICU4X Development"
env = { ICU4X_DATA_DIR = "../stubdata" }
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.71.1 --profile minimal
exec --fail-on-error cargo +1.71.1 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-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"
env = { ICU4X_DATA_DIR = "../stubdata" }
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"
env = { ICU4X_DATA_DIR = "../stubdata" }
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.71.1 --profile minimal
exec --fail-on-error cargo +1.71.1 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"
env = { ICU4X_DATA_DIR = "../stubdata" }
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.71.1 --profile minimal
exec --fail-on-error cargo +1.71.1 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"
env = { ICU4X_DATA_DIR = "../stubdata" }
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.71.1 --profile minimal
exec --fail-on-error cargo +1.71.1 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"
env = { ICU4X_DATA_DIR = "../stubdata" }
dependencies = [
"clippy-all",
]
[tasks.ci-job-doc]
description = "Runs rustdoc generation for the CI 'doc' job"
category = "CI"
env = { RUSTDOCFLAGS = "-Dwarnings", ICU4X_DATA_DIR = "../stubdata" }
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
]
# For the nightly and beta CI, we set
# - a rustup override
# - CI_TOOLCHAIN: gets set to either "pinned-stable", "beta", or "nightly"
# - PINNED_CI_NIGHTLY: Set to "nightly" if we want to use the latest nightly
#
# When updating the toolchain, please audit all cases of CI_TOOLCHAIN and remove cfgs where necessary.
[tasks.set-ci-toolchain]
description = "Set all toolchain 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
ci_toolchain = set "pinned-stable"
echo "set-ci-toolchain: GITHUB_EVENT_NAME is ${event_name}"
# We need to parse the channel information for dispatch/schedule events
is_workflow = eq "${event_name}" "workflow_dispatch"
is_schedule = eq "${event_name}" "schedule"
if ${is_workflow} or ${is_schedule}
event_path = get_env GITHUB_EVENT_PATH
event_file = readfile ${event_path}
event_json = json_parse ${event_file}
# For dispatch events
if ${is_workflow}
echo "set-ci-toolchain: manually selected channel is ${event_json.inputs.channel}"
if not eq "${event_json.inputs.channel}" "pinned-stable"
needs_override = set true
ci_toolchain = set "${event_json.inputs.channel}"
end
else
echo "set-ci-toolchain: cronjob is scheduled at ${event_json.schedule}"
# 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 * * *"
ci_toolchain = set "beta"
else
ci_toolchain = set "nightly"
end
end
end
if not eq ${ci_toolchain} "pinned-stable"
echo "Setting up CI environment for forced-${ci_toolchain} Rust build"
appendfile ${env_file} "CI_TOOLCHAIN=${ci_toolchain}\n"
exec rustup override set ${ci_toolchain}
if starts_with "${ci_toolchain}" "nightly"
# This affects tasks that can only be built on nightly
appendfile ${env_file} "PINNED_CI_NIGHTLY=${ci_toolchain}\n"
end
else
echo "forced-toolchain environment not required"
end
'''