forked from unicode-org/icu4x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
266 lines (232 loc) · 7.43 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
# 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-04-18", 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 = [
"check",
"check-no-features",
"ci-job-fmt",
"ci-job-clippy",
"check-cargo-tutorial-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", "--all-targets", "--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.61 --profile minimal
exec --fail-on-error cargo +1.61 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-cargo-tutorial]
description = "Run all checks for the CI 'test-cargo-tutorial' job"
category = "CI"
dependencies = [
"test-cargo-tutorial-local",
]
[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",
"full-data",
]
[tasks.ci-job-ffi]
description = "Run all tests for the CI 'ffi' job"
category = "CI"
dependencies = [
"test-ffi",
]
[tasks.ci-job-verify-ffi]
description = "Run all tests for the CI 'verify-ffi' job"
category = "CI"
dependencies = [
"verify-ffi",
]
[tasks.ci-job-gn]
description = "Run all tests for the CI 'gn' job"
category = "CI"
dependencies = [
"gn-run",
]
[tasks.ci-job-verify-gn]
description = "Run all tests for the CI 'verify-gn' job"
category = "CI"
dependencies = [
"verify-gn-gen",
]
[tasks.ci-job-msrv-features]
description = "Run all tests for the CI 'features' job"
category = "CI"
script_runner = "@duckscript"
script = '''
exec --fail-on-error rustup install 1.61 --profile minimal
exec --fail-on-error cargo +1.61 make check-all-features
'''
[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-wasm]
description = "Run all tests for the CI 'wasm' job"
category = "CI"
dependencies = [
"test-cpp-emscripten",
]
[tasks.ci-job-clippy]
# Note: ci-job-clippy is not actually invoked by CI and instead exists
# for symmetry and predictability. CI instead uses a special GitHub action
# that allows it to integrate better with GitHub annotations
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 = { RUSTFLAGS = "-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-msrv-check",
"ci-job-fmt",
"ci-job-clippy",
"ci-job-tidy",
"ci-job-doc",
# Get a coffee
"ci-job-test",
"ci-job-test-docs",
"ci-job-testdata",
"ci-job-msrv-features",
"ci-job-full-datagen",
# Needs tools other than Cargo to be installed
"ci-job-ffi",
"ci-job-wasm",
"ci-job-verify-ffi",
"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
'''