-
Notifications
You must be signed in to change notification settings - Fork 182
777 lines (678 loc) · 24.3 KB
/
build-test.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
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
# 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 ).
name: Build and Test
# Each of these jobs job maps to a `ci-job-foo` entry in Makefile.toml.
# If adding further CI jobs, please add them as makefile targets as well,
# and list them under `ci-all`.
on:
push:
branches: [ main ]
pull_request:
branches: '*'
workflow_dispatch:
inputs:
nightly:
description: "Test on latest nightly"
required: true
default: false
type: boolean
schedule:
# Run nightly cronjob CI every day at 14 UTC / 6AM PST / 3PM CET
- cron: '0 14 * * *'
concurrency:
# Allow one run at a time for PRs, but multiple for other invocations
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ci-job-check & ci-job-features
# Running at MSRV (1.66)
msrv:
runs-on: ubuntu-latest
# Defined as a matrix so that features can start immediately, but
# be killed if check fails.
strategy:
matrix:
behavior: [check, features-1, features-2, features-3]
fail-fast: true
# Set CARGO_HTTP_MULTIPLEXING=false to work around crates.io curl bug:
# <https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation>
env:
CARGO_HTTP_MULTIPLEXING: false
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Cargo-all-features boilerplate
- name: Get cargo-all-features version
id: cargo-all-features-version
run: |
echo "hash=$(cargo search cargo-all-features | grep '^cargo-all-features =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-all-features
uses: actions/cache@v3
id: cargo-all-features-cache
with:
path: |
~/.cargo/bin/cargo-all-features
~/.cargo/bin/cargo-all-features.exe
key: ${{ runner.os }}-all-features-${{ steps.cargo-all-features-version.outputs.hash }}
- name: Install cargo-all-features
if: steps.cargo-all-features-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-all-features
# No toolchain boilerplate as this runs on MSRV
# Actual job
- name: Check
run: cargo make ci-job-msrv-${{ matrix.behavior }}
# ci-job-test
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Actual job
- name: Run `cargo make ci-job-test`
if: matrix.os != 'windows-latest'
run: cargo make ci-job-test
- name: Run `cargo make ci-job-test-windows`
if: matrix.os == 'windows-latest'
run: cargo make ci-job-test-windows
# ci-job-test-tutorials
test-tutorials:
runs-on: ubuntu-latest
strategy:
matrix:
behavior: [local, cratesio]
fail-fast: false
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x-source-cache
# Actual job
- name: Run `cargo make ci-job-test-tutorials-${{ matrix.behavior }}`
run: cargo make ci-job-test-tutorials-${{ matrix.behavior }}
# ci-job-testdata
testdata:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Cargo-all-features boilerplate
- name: Get cargo-all-features version
id: cargo-all-features-version
run: |
echo "hash=$(cargo search cargo-all-features | grep '^cargo-all-features =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-all-features
uses: actions/cache@v3
id: cargo-all-features-cache
with:
path: |
~/.cargo/bin/cargo-all-features
~/.cargo/bin/cargo-all-features.exe
key: ${{ runner.os }}-all-features-${{ steps.cargo-all-features-version.outputs.hash }}
- name: Install cargo-all-features
if: steps.cargo-all-features-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-all-features
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x-source-cache
# Actual job
- name: Run `cargo make testdata-check`
run: cargo make testdata-check
- name: Run `cargo make testdata-legacy`
run: cargo make testdata-legacy
# This is too slow for Windows and Mac
- name: Run `cargo make testdata-legacy-test`
if: matrix.os == 'ubuntu-latest'
run: cargo make testdata-legacy-test
# ci-job-test-docs
test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Actual job
- name: Run `cargo make ci-job-test-docs`
run: cargo make ci-job-test-docs
# ci-job-full-datagen
full-datagen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x-source-cache
- name: Install rustfmt
run: rustup component add rustfmt
# Actual job
- name: Run `cargo make ci-job-full-datagen`
run: cargo make ci-job-full-datagen
# ci-job-ffi
ffi:
runs-on: ubuntu-latest
container:
image: rust:bookworm
steps:
- uses: actions/checkout@v3
# Software setup/installation for the container
- name: Run apt-get update
run: |
apt-get update
- name: Install Clang-15
run: |
apt-get install -y clang-15 lld-15 llvm-15-dev libc++-15-dev
- name: Install GCC 11
run: |
apt-get install -y gcc-11 g++-11
- name: Install Node.js v16.18.0
uses: actions/setup-node@v3
with:
node-version: 16.18.0
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install Rust toolchains
run: |
rustup toolchain install stable
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
# Since this is inside a container, use a different key than the other jobs
key: ${{ runner.os }}-make-ffi-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load download cache
uses: actions/cache@v3
with:
key: download-cache
path: /tmp/icu4x-source-cache
- name: Warm up datagen
# We do this so its compilation doesn't go on the time bugdet of the
# first test that uses it.
run: cargo build -p icu_datagen
# Actual job
- name: Run `cargo make ci-job-ffi`
run: cargo make ci-job-ffi
env:
CXX: "g++-11"
# ci-job-verify-ffi
verify-ffi:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Run diplomat-get-rev to ensure it works
id: diplomat-getrev-check
run: cargo make --loglevel error diplomat-get-rev
- name: Get Diplomat version
id: diplomat-version
run: |
echo "::set-output name=rev::$(cargo make --loglevel error diplomat-get-rev | tr -d '[:space:]')"
shell: bash
- name: Attempt to load cached Diplomat
uses: actions/cache@v3
id: diplomat-cache
with:
path: |
~/.cargo/bin/diplomat-tool
~/.cargo/bin/diplomat-tool.exe
key: ${{ runner.os }}-diplomat-${{ steps.diplomat-version.outputs.rev }}
- name: Install Diplomat (git hash)
if: steps.diplomat-cache.outputs.cache-hit != 'true' && !contains(steps.diplomat-version.outputs.rev, '.')
run: cargo +stable install --git https://github.com/rust-diplomat/diplomat.git --rev ${{ steps.diplomat-version.outputs.rev }} diplomat-tool
- name: Install Diplomat (versioned)
if: steps.diplomat-cache.outputs.cache-hit != 'true' && contains(steps.diplomat-version.outputs.rev, '.')
run: cargo +stable install --git https://github.com/rust-diplomat/diplomat.git --version ${{ steps.diplomat-version.outputs.rev }} diplomat-tool
# Actual job
- name: Run `cargo make ci-job-verify-ffi`
run: cargo make ci-job-verify-ffi
# ci-job-verify-gn, ci-job-gn
gn:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Attempt to load cached GN Third-Party Tools
uses: actions/cache@v3
id: gn-third-party-tools-cache
with:
path: |
ffi/gn/third_party_tools
key: ${{ runner.os }}-${{ hashFiles('tools/make/gn.toml', 'ffi/gn/Cargo.lock') }}
- name: Install GN Third-Party Tools
if: steps.gn-third-party-tools-cache.outputs.cache-hit != 'true'
run: cargo make gn-install
- name: Get cargo-rdme version
id: cargo-readme-version
run: |
echo "::set-output name=hash::$(cargo search cargo-rdme | grep '^cargo-rdme =' | md5sum)"
shell: bash
- name: Attempt to load cached cargo-rdme
uses: actions/cache@v3
id: cargo-rdme-cache
with:
path: |
~/.cargo/bin/cargo-rdme
~/.cargo/bin/cargo-rdme.exe
key: ${{ runner.os }}-readme-${{ steps.cargo-rdme-version.outputs.hash }}
- name: Install cargo-rdme
if: steps.cargo-rdme-cache.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: cargo-rdme
version: latest
# Actual job
- name: Run `cargo make ci-job-verify-gn`
run: cargo make ci-job-verify-gn
- name: Run `cargo make ci-job-gn`
run: cargo make ci-job-gn
# ci-job-wasm
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Install emsdk
run: |
cd ~
git clone https://github.com/emscripten-core/emsdk.git --branch 2.0.27
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Install Node.js v16.18.0
uses: actions/setup-node@v3
with:
node-version: 16.18.0
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Actual job
- name: Run emscripten/wasm test
run: |
. ~/emsdk/emsdk_env.sh
cargo make ci-job-wasm
# ci-job-fmt
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Install rustfmt
run: rustup component add rustfmt
# Actual job
- name: Check Format
run: cargo make ci-job-fmt
# ci-job-tidy
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Get cargo-rdme version
id: cargo-readme-version
run: |
echo "::set-output name=hash::$(cargo search cargo-rdme | grep '^cargo-rdme =' | md5sum)"
shell: bash
- name: Attempt to load cached cargo-rdme
uses: actions/cache@v3
id: cargo-rdme-cache
with:
path: |
~/.cargo/bin/cargo-rdme
~/.cargo/bin/cargo-rdme.exe
key: ${{ runner.os }}-readme-${{ steps.cargo-rdme-version.outputs.hash }}
- name: Install cargo-rdme
if: steps.cargo-rdme-cache.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: cargo-rdme
version: latest
# Actual job
- name: Tidy
run: cargo make ci-job-tidy
# ci-job-clippy
clippy:
# We don't expect to be clippy-clean on nightly cronjob.
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Job-specific dependencies
- name: Install clippy
run: rustup component add clippy
# Actual job
- name: Run `ci-job-clippy`
run: cargo make ci-job-clippy
# ci-job-doc
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cargo-make boilerplate
- name: Get cargo-make version
id: cargo-make-version
run: |
echo "hash=$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" >> $GITHUB_OUTPUT
shell: bash
- name: Attempt to load cached cargo-make
uses: actions/cache@v3
id: cargo-make-cache
with:
path: |
~/.cargo/bin/cargo-make
~/.cargo/bin/cargo-make.exe
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
- name: Install cargo-make
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
run: cargo +stable install cargo-make
# Toolchain boilerplate
- name: Potentially override rust version with nightly
run: cargo make set-nightly-version-for-ci
- name: Show the selected Rust toolchain
run: rustup show
# Actual job
- name: Cargo doc
run: cargo make ci-job-doc
# Notify on slack
notify-slack:
# Skipped tasks: bench-perf, bench-memory, bench-binsize, bench-datasize
needs: [msrv, test, testdata, test-docs, full-datagen, ffi, verify-ffi, gn, wasm, fmt, tidy, clippy, doc]
if: ${{ always() && contains(needs.*.result, 'failure') && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == 'main')) }}
runs-on: ubuntu-latest
steps:
- name: Notify slack of failure
uses: ravsamhq/notify-slack-action@v1
with:
notify_when: failure
status: failure # We do the filtering earlier
notification_title: ''
message_format: ${{ format('{{emoji}} {0} CI failed!' , ((github.event_name == 'schedule') && 'Nightly' || (github.event_name == 'push') && 'Main' || 'Manually dispatched')) }}
footer: '<{run_url}|View failure> | <https://github.com/unicode-org/icu4x/actions?query=event%3A${{ github.event_name }}|CI history for `${{ github.event_name }}`>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}