forked from unicode-org/icu4x
-
Notifications
You must be signed in to change notification settings - Fork 1
596 lines (520 loc) · 25.1 KB
/
artifacts-build.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
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# 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 ).
##### README #####
#
# The CI action in this file is used to build the artifacts on pushes to a repository containing
# the ICU4X service account key. All steps are skipped unless the key is present.
#
# If you are a frequent contributor, you can add the key to your fork. The key is shared with
# icu4x collaborators and can be viewed here:
#
# https://drive.google.com/file/d/1LHq_sUb5NgpfDrJBcp3EsJFiUmoDbj36/view
#
# To add the key, follow these steps:
#
# 1. Go to the secrets on your fork:
# - https://github.com/{USER}/icu4x/settings/secrets/actions
# 2. Click "New repository secret" and enter the following information:
# - Name: ICU4X_GCP_SA_KEY
# - Value: The contents of the file linked above
# 3. Click "Add secret"
# 4. Re-run the latest "Artifacts Build" action on your fork to make sure it works:
# - https://github.com/{USER}/icu4x/actions/workflows/artifacts-build.yml
name: Artifacts Build
on:
push
permissions:
contents: read
pages: write
id-token: write
env:
GCP_PROJECT_ID: "dev-infra-273822"
GCP_PR_BUCKET_ID: "icu4x-pr-artifacts"
GCP_MAIN_BUCKET_ID: "icu4x-main"
jobs:
credentials:
name: "Check Credentials for jobs that need JSON credentials"
runs-on: "ubuntu-latest"
env:
ICU4X_GCP_SA_KEY: "${{ secrets.ICU4X_GCP_SA_KEY }}"
steps:
- name: "Check for credentials"
run: |
if [ -z "$ICU4X_GCP_SA_KEY" ]
then
echo "GCP key not found. Docs previews will not be uploaded. If you are a frequent contributor, you may add the key to your fork; for instructions, see 'artifacts-build.yml'"
exit 1;
fi
rust-docs:
name: "Rust docs"
needs: credentials
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main or forked repository (needs credentials)
- id: gcp-auth
if: github.ref != 'refs/heads/main' || github.repository != 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with JSON Credentials"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
credentials_json: '${{ secrets.ICU4X_GCP_SA_KEY }}'
- id: gcp-auth-main
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Build docs
run: >
cargo doc --workspace --release --all-features --no-deps --lib
--exclude icu_benchmark_macros
--exclude icu_ffi_coverage
--exclude md-tests
--exclude icu_provider_macros
--exclude databake-derive
--exclude yoke-derive
--exclude zerofrom-derive
--exclude zerovec-derive
- name: Upload docs to Google Cloud Storage (non-main)
run: |
gsutil -m cp -r target/doc gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/rustdoc
- name: Upload docs to Google Cloud Storage (main)
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
run: |
gsutil -m cp -r target/doc/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/rustdoc
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "📖 Rust docs"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/rustdoc/icu/index.html"
cpp-docs:
name: "C++ docs"
needs: credentials
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main or forked repository (needs credentials)
- id: gcp-auth
if: github.ref != 'refs/heads/main' || github.repository != 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with JSON Credentials"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
credentials_json: '${{ secrets.ICU4X_GCP_SA_KEY }}'
- id: gcp-auth-main
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Install doxygen-awesome
run: |
git clone --depth 1 https://github.com/jothepro/doxygen-awesome-css.git
- name: Build docs
uses: mattnotmitt/doxygen-action@411df0c62acb5b96b8a93d93a7bf4b753c47ea05 # v1.9.5
with:
doxyfile-path: 'tools/config.doxy'
- name: Upload docs to Google Cloud Storage (non-main)
run: |
gsutil -m cp -r html gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/cppdoc
- name: Upload docs to Google Cloud Storage (main)
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
run: |
gsutil -m cp -r html/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/cppdoc
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "📖 C++ docs"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/cppdoc/index.html"
ts-docs:
name: "TypeScript docs"
needs: credentials
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main or forked repository (needs credentials)
- id: gcp-auth
if: github.ref != 'refs/heads/main' || github.repository != 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with JSON Credentials"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
credentials_json: '${{ secrets.ICU4X_GCP_SA_KEY }}'
- id: gcp-auth-main
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Build docs
run: |
cd ffi/npm
make lib/index.mjs
npm install [email protected] --exact
node_modules/typedoc/bin/typedoc lib/index.d.ts --out docs --readme ../../tutorials/js.md --basePath lib
cd ../..
- name: Upload docs to Google Cloud Storage (non-main)
run: |
gsutil -m cp -r ffi/npm/docs gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/tsdoc
- name: Upload docs to Google Cloud Storage (main)
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
run: |
gsutil -m cp -r ffi/npm/docs/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/tsdoc
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "📖 TypeScript docs"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/tsdoc/index.html"
dart-docs:
name: "Dart docs"
needs: credentials
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main or forked repository (needs credentials)
- id: gcp-auth
if: github.ref != 'refs/heads/main' || github.repository != 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with JSON Credentials"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
credentials_json: '${{ secrets.ICU4X_GCP_SA_KEY }}'
- id: gcp-auth-main
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Install Dart
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 # v1.6.5
with:
sdk: 3.4.0-204.0.dev
- name: Build docs
run: |
cd ffi/dart
make lib/src/lib.g.dart
# https://github.com/dart-lang/dartdoc/issues/3590
dart pub get
dart doc
cd ../..
- name: Upload docs to Google Cloud Storage (non-main)
run: |
gsutil -m cp -r ffi/dart/doc/api gs://${{ env.GCP_PR_BUCKET_ID }}/gha/${{ github.sha }}/dartdoc
- name: Upload docs to Google Cloud Storage (main)
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
run: |
gsutil -m cp -r ffi/dart/doc/api/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/dartdoc
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "📖 Dart docs"
echo "http://${{ env.GCP_PR_BUCKET_ID }}.storage.googleapis.com/gha/${{ github.sha }}/dartdoc/index.html"
wasm-demo:
# This is too expensive to run on every push, so only run it on main.
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
name: WASM Demo
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main repository
- id: gcp-auth
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Init packages
run: |
npm -C ffi/npm ci
npm -C tutorials/web-demo ci
env:
PINNED_CI_NIGHTLY: nightly-2024-07-23
- name: Run Webpack
run: npm -C tutorials/web-demo run build
- name: Upload wasm-demo bundle to Google Cloud Storage
run: |
gsutil -m cp -r tutorials/web-demo/public/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/wasm-demo
- name: "⭐⭐⭐ Links to Uploaded Artifacts ⭐⭐⭐"
run: |
echo "Wasm Demo Preview"
echo "https://storage.googleapis.com/${{ env.GCP_MAIN_BUCKET_ID }}/gha/wasm-demo/index.html"
bench-perf:
# This is too expensive to run on every push, so only run it on main.
# When running on a PR, comment this out and set the BASELINE variable below to the baseline commit.
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
component:
- components/collections
- components/datetime
# - components/experimental
- components/locale_core
- components/locale
- components/plurals
- components/segmenter
- provider/blob
- utils/fixed_decimal
- utils/litemap
- utils/tinystr
- utils/writeable
- utils/zerotrie
- utils/zerovec
concurrency:
# Allow one run at a time to include the previous run's results
group: bench-perf-${{ matrix.component }}
# If you are modifying and debugging is required, don't be afraid to get
# messy in a personal fork, if no better way to do it.
# Example "debugging" workflow: https://github.com/echeran/icu4x/actions/runs/296714990
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main repository
- id: gcp-auth
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
# Cargo-make boilerplate
- name: Install cargo-make
uses: taiki-e/install-action@64e4e2f995104968c78bd697b253d55bf557af66 # v2.41.11
with:
tool: [email protected]
# Actual job
- name: Setup output data directory
run: |
mkdir -p benchmarks/perf/${{ matrix.component }}
- name: Run benchmark
shell: /usr/bin/bash -o pipefail -e {0}
run: |
cargo bench --features bench --manifest-path ${{ matrix.component }}/Cargo.toml -- --output-format bencher | tee benchmarks/perf/${{ matrix.component }}/output.txt;
- name: Download previous benchmark data
run: |
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/perf/${{ matrix.component }}/* benchmarks/perf/${{ matrix.component }}
- name: Store benchmark result & create dashboard
uses: rhysd/github-action-benchmark@c3efd4d54319dbc90622069cc273cba59b46abbf # v1.15.0
with:
name: Rust Benchmark
tool: 'cargo'
output-file-path: ./benchmarks/perf/${{ matrix.component }}/output.txt
benchmark-data-dir-path: ./benchmarks/perf/${{ matrix.component }}
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%' # If for nothing else, enabling the possibility of alerts with meaningful thresholds requires this job to be done per-component
fail-on-alert: true
# comment-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: empty
# alert-comment-cc-users: '@sffc,@zbraniecki,@echeran'
- name: Upload new benchmark data
if: success() || failure()
run: |
git checkout empty
gsutil -m cp -r benchmarks/perf/${{ matrix.component }}/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/perf/${{ matrix.component }}
# Run examples with dhat-rs in order to collect memory heap size metrics. These
# metrics will then be charted over time. See tools/benchmark/memory/README.md for
# more information.
# dhat-rs:
# https://github.com/nnethercote/dhat-rs
# Benchmarking action (forked):
# https://github.com/gregtatum/github-action-benchmark
# The memory data is collected in:
# benchmarks/memory/{os}/output.ndjson
# The full data report is stored in:
# benchmarks/memory/{os}/{example}-dhat-heap.json
bench-memory:
# This is too expensive to run on every push, so only run it on main.
# When running on a PR, comment this out and set the BASELINE variable below to the baseline commit.
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
strategy:
fail-fast: false
# Create a matrix of all platforms, and all components. Each job then can run
# multiple examples in that job. The examples are defined as a space separated
# list of the name of the examples. The examples are assumed to be in the
# examples folder.
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
concurrency:
# Allow one run at a time to include the previous run's results
group: bench-memory-${{ matrix.os }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# gsutil needs Python 3.11 but macos-latest has 3.12
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
# GCP Boilerplate for jobs in main repository
- id: gcp-auth
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
# Cargo-make boilerplate
- name: Install cargo-make
uses: taiki-e/install-action@64e4e2f995104968c78bd697b253d55bf557af66 # v2.41.11
with:
tool: [email protected]
# Actual job
- name: Run the example with dhat-rs to collect memory information
run: |
cargo run --package icu_benchmark_memory -- --os ${{ matrix.os }}
- name: Download previous benchmark data
run: |
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/memory/${{ matrix.os }}/* benchmarks/memory/${{ matrix.os }}
- name: Store benchmark result & create dashboard
# The gregtatum fork of rhysd/github-action-benchmark contains support for ndjson.
# If the PR gets merged, this can be switched back to the main project.
# https://github.com/rhysd/github-action-benchmark/pull/54
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
name: Heap – ${{ matrix.os }}
# The ndjson tool is only supported by the gregtatum fork of github-action-benchmark.
tool: 'ndjson'
benchmark-data-dir-path: ./benchmarks/memory/${{ matrix.os }}
output-file-path: ./benchmarks/memory/${{ matrix.os }}/output.ndjson
alert-threshold: '200%'
fail-on-alert: true
# comment-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: empty
# alert-comment-cc-users: '@sffc,@zbraniecki,@echeran'
- name: Upload new benchmark data
if: success() || failure()
run: |
git checkout empty
# Delete intermediate files
rm benchmarks/memory/${{ matrix.os }}/*-dhat-heap.json
gsutil -m cp -r benchmarks/memory/${{ matrix.os }}/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/memory/${{ matrix.os }}
# Binary size benchmark: build and size wasm binaries; creates ndjson output data format
bench-binsize:
# This is too expensive to run on every push, so only run it on main.
# When running on a PR, comment this out and set the BASELINE variable below to the baseline commit.
if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x'
runs-on: ubuntu-latest
concurrency:
# Allow one run at a time to include the previous run's results
group: bench-binsize
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main repository
- id: gcp-auth
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
# Cargo-make boilerplate
- name: Install cargo-make
uses: taiki-e/install-action@64e4e2f995104968c78bd697b253d55bf557af66 # v2.41.11
with:
tool: [email protected]
# Job-specific dependencies
- name: Install npm tools
run: |
npm install -g [email protected] --exact
# Actual job
- name: Build wasm executables
run: cargo make wasm-opt
- name: gzip wasm executables
run: |
cd wasmpkg/wasm-opt
gzip -k *+opt.wasm
cd ../..
- name: Setup output data directory
run: |
mkdir -p benchmarks/binsize/wasm
mkdir -p benchmarks/binsize/gz
- name: Measure size of executables (wasm)
shell: /usr/bin/bash -o pipefail -e {0}
run: |
cargo run --package icu_benchmark_binsize -- wasmpkg/wasm-opt wasm | tee benchmarks/binsize/wasm/output.txt
- name: Measure size of executables (gz)
shell: /usr/bin/bash -o pipefail -e {0}
run: |
cargo run --package icu_benchmark_binsize -- wasmpkg/wasm-opt gz | tee benchmarks/binsize/gz/output.txt
- name: Download previous benchmark data
run: |
mkdir -p benchmarks/binsize
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/binsize/* benchmarks/binsize
- name: Store benchmark result & create dashboard (wasm)
# Use gregtatum special feature to process ndjson-formatted benchmark data
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
tool: 'ndjson'
output-file-path: benchmarks/binsize/wasm/output.txt
benchmark-data-dir-path: ./benchmarks/binsize/wasm
# Tentative setting, optimized value to be determined
alert-threshold: '200%'
fail-on-alert: true
# comment-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: empty
# alert-comment-cc-users: '@gnrunge,@sffc,@zbraniecki,@echeran'
- name: Store benchmark result & create dashboard (gz)
if: success() || failure()
# Use gregtatum special feature to process ndjson-formatted benchmark data
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
tool: 'ndjson'
output-file-path: benchmarks/binsize/gz/output.txt
benchmark-data-dir-path: ./benchmarks/binsize/gz
# Tentative setting, optimized value to be determined
alert-threshold: '200%'
fail-on-alert: true
# comment-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: empty
skip-fetch-gh-pages: true
# alert-comment-cc-users: '@gnrunge,@sffc,@zbraniecki,@echeran'
- name: Upload new benchmark data
if: success() || failure()
run: |
git checkout empty
gsutil -m cp -r benchmarks/binsize/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/binsize
gh-pages:
name: "Deploy to GitHub Pages"
needs: [rust-docs, cpp-docs, ts-docs, dart-docs, wasm-demo, bench-perf, bench-memory] # bench-binsize
# Run this even when one of the above jobs failed. This is so we can at least push the other artifacts.
if: (success() || failure()) && (github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x')
runs-on: 'ubuntu-latest'
concurrency:
group: "pages"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# GCP Boilerplate for jobs in main repository
- id: gcp-auth
name: "Authenticate to Google Cloud with Workload Identity Provider"
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1"
service_account: "[email protected]"
- name: "Set up Google Cloud SDK"
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Download artifacts
run: |
mkdir website
gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/* website || true
- name: Upload artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0
with:
path: 'website'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@f27bcc15848fdcdcc02f01754eb838e44bcf389b # v1.2.9