18
18
branches : [ main ]
19
19
pull_request :
20
20
branches : ' *'
21
+ workflow_dispatch :
22
+ inputs :
23
+ nightly :
24
+ description : " Test on latest nightly"
25
+ required : true
26
+ default : false
27
+ type : boolean
28
+ schedule :
29
+ # Run nightly cronjob CI every day at 14 UTC / 6AM PST / 3PM CET
30
+ - cron : ' 0 14 * * *'
31
+
32
+ env :
33
+ INSTALLED_NIGHTLY_VERSION : nightly-2022-04-05
21
34
22
35
jobs :
23
36
26
39
runs-on : ubuntu-latest
27
40
steps :
28
41
- uses : actions/checkout@v2
42
+ - name : Potentially override rust version with nightly
43
+ # pull_request is a fake for me to be able to test this for now
44
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
45
+ run : |
46
+ rustup override set nightly
47
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
48
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
29
49
- name : Load the default Rust toolchain via the rust-toolchain file.
30
50
run : rustup show
31
51
65
85
66
86
steps :
67
87
- uses : actions/checkout@v2
88
+ - name : Potentially override rust version with nightly
89
+ # pull_request is a fake for me to be able to test this for now
90
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
91
+ run : |
92
+ rustup override set nightly
93
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
94
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
68
95
- name : Load the default Rust toolchain via the rust-toolchain file.
69
96
run : rustup show
70
97
- name : Get cargo-make version
@@ -100,6 +127,13 @@ jobs:
100
127
101
128
steps :
102
129
- uses : actions/checkout@v2
130
+ - name : Potentially override rust version with nightly
131
+ # pull_request is a fake for me to be able to test this for now
132
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
133
+ run : |
134
+ rustup override set nightly
135
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
136
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
103
137
- name : Load the default Rust toolchain via the rust-toolchain file.
104
138
run : rustup show
105
139
- name : Get cargo-make version
@@ -145,6 +179,13 @@ jobs:
145
179
runs-on : ubuntu-latest
146
180
steps :
147
181
- uses : actions/checkout@v2
182
+ - name : Potentially override rust version with nightly
183
+ # pull_request is a fake for me to be able to test this for now
184
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
185
+ run : |
186
+ rustup override set nightly
187
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
188
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
148
189
- name : Load the default Rust toolchain via the rust-toolchain file.
149
190
run : rustup show
150
191
- name : Get cargo-make version
@@ -177,6 +218,13 @@ jobs:
177
218
runs-on : ubuntu-latest
178
219
steps :
179
220
- uses : actions/checkout@v2
221
+ - name : Potentially override rust version with nightly
222
+ # pull_request is a fake for me to be able to test this for now
223
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
224
+ run : |
225
+ rustup override set nightly
226
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
227
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
180
228
- name : Load the default Rust toolchain via the rust-toolchain file.
181
229
run : rustup show
182
230
- name : Attempt to load cached CLDR source data
@@ -227,17 +275,24 @@ jobs:
227
275
228
276
steps :
229
277
- uses : actions/checkout@v2
278
+ - name : Potentially override rust version with nightly
279
+ # pull_request is a fake for me to be able to test this for now
280
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
281
+ run : |
282
+ rustup override set nightly
283
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
284
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
230
285
- name : Load the default Rust toolchain via the rust-toolchain file.
231
286
run : rustup show
232
287
233
288
- name : Load cortex target for no_std build.
234
289
run : |
235
- rustup install nightly-2022-04-05
236
- rustup component add --toolchain nightly-2022-04-05 rust-src
237
- rustup target add thumbv7m-none-eabi --toolchain nightly-2022-04-05
238
- rustup target add thumbv8m.main-none-eabihf --toolchain nightly-2022-04-05
239
- rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2022-04-05
240
- rustup target add wasm32-unknown-unknown --toolchain nightly-2022-04-05
290
+ rustup install $INSTALLED_NIGHTLY_VERSION
291
+ rustup component add --toolchain $INSTALLED_NIGHTLY_VERSION rust-src
292
+ rustup target add thumbv7m-none-eabi --toolchain $INSTALLED_NIGHTLY_VERSION
293
+ rustup target add thumbv8m.main-none-eabihf --toolchain $INSTALLED_NIGHTLY_VERSION
294
+ rustup target add x86_64-unknown-linux-gnu --toolchain $INSTALLED_NIGHTLY_VERSION
295
+ rustup target add wasm32-unknown-unknown --toolchain $INSTALLED_NIGHTLY_VERSION
241
296
242
297
- name : Set up Clang-14
243
298
run : |
@@ -291,6 +346,13 @@ jobs:
291
346
292
347
steps :
293
348
- uses : actions/checkout@v2
349
+ - name : Potentially override rust version with nightly
350
+ # pull_request is a fake for me to be able to test this for now
351
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
352
+ run : |
353
+ rustup override set nightly
354
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
355
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
294
356
- name : Load the default Rust toolchain via the rust-toolchain file.
295
357
run : rustup show
296
358
- name : Load nightly for rustdoc-json
@@ -363,6 +425,13 @@ jobs:
363
425
364
426
steps :
365
427
- uses : actions/checkout@v2
428
+ - name : Potentially override rust version with nightly
429
+ # pull_request is a fake for me to be able to test this for now
430
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
431
+ run : |
432
+ rustup override set nightly
433
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
434
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
366
435
- name : Load the default Rust toolchain via the rust-toolchain file.
367
436
run : rustup show
368
437
@@ -388,9 +457,9 @@ jobs:
388
457
389
458
- name : Load wasi for gn.
390
459
run : |
391
- rustup install nightly-2022-04-05
392
- rustup component add --toolchain nightly-2022-04-05 rust-src
393
- rustup target add wasm32-wasi --toolchain nightly-2022-04-05
460
+ rustup install $INSTALLED_NIGHTLY_VERSION
461
+ rustup component add --toolchain $INSTALLED_NIGHTLY_VERSION rust-src
462
+ rustup target add wasm32-wasi --toolchain $INSTALLED_NIGHTLY_VERSION
394
463
395
464
- name : Attempt to load cached GN Third-Party Tools
396
465
uses : actions/cache@v3
@@ -424,6 +493,13 @@ jobs:
424
493
needs : [check]
425
494
steps :
426
495
- uses : actions/checkout@v2
496
+ - name : Potentially override rust version with nightly
497
+ # pull_request is a fake for me to be able to test this for now
498
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
499
+ run : |
500
+ rustup override set nightly
501
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
502
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
427
503
- name : Load the default Rust toolchain via the rust-toolchain file.
428
504
run : rustup show
429
505
- name : Install cargo-all-features
@@ -465,12 +541,19 @@ jobs:
465
541
466
542
steps :
467
543
- uses : actions/checkout@v2
544
+ - name : Potentially override rust version with nightly
545
+ # pull_request is a fake for me to be able to test this for now
546
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
547
+ run : |
548
+ rustup override set nightly
549
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
550
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
468
551
- name : Load nightly Rust toolchain for WASM.
469
552
run : |
470
- rustup install nightly-2022-04-05
471
- rustup target add wasm32-unknown-unknown --toolchain nightly-2022-04-05
472
- rustup target add wasm32-unknown-emscripten --toolchain nightly-2022-04-05
473
- rustup component add rust-src --toolchain nightly-2022-04-05
553
+ rustup install $INSTALLED_NIGHTLY_VERSION
554
+ rustup target add wasm32-unknown-unknown --toolchain $INSTALLED_NIGHTLY_VERSION
555
+ rustup target add wasm32-unknown-emscripten --toolchain $INSTALLED_NIGHTLY_VERSION
556
+ rustup component add rust-src --toolchain $INSTALLED_NIGHTLY_VERSION
474
557
475
558
- name : Get cargo-make version
476
559
id : cargo-make-version
@@ -514,7 +597,13 @@ jobs:
514
597
runs-on : ubuntu-latest
515
598
steps :
516
599
- uses : actions/checkout@v2
517
-
600
+ - name : Potentially override rust version with nightly
601
+ # pull_request is a fake for me to be able to test this for now
602
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
603
+ run : |
604
+ rustup override set nightly
605
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
606
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
518
607
- name : Load the default Rust toolchain via the rust-toolchain file.
519
608
run : rustup show
520
609
@@ -555,7 +644,13 @@ jobs:
555
644
runs-on : ubuntu-latest
556
645
steps :
557
646
- uses : actions/checkout@v2
558
-
647
+ - name : Potentially override rust version with nightly
648
+ # pull_request is a fake for me to be able to test this for now
649
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
650
+ run : |
651
+ rustup override set nightly
652
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
653
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
559
654
- name : Load the default Rust toolchain via the rust-toolchain file.
560
655
run : rustup show
561
656
@@ -610,10 +705,11 @@ jobs:
610
705
# Clippy job (cargo-clippy) - completes and puts warnings inline in PR
611
706
clippy :
612
707
runs-on : ubuntu-latest
613
-
708
+ # We don't expect to keep being clippy-clean on nightly Rust
709
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
614
710
steps :
615
- - uses : actions/checkout@v2
616
711
712
+ - uses : actions/checkout@v2
617
713
- name : Load the default Rust toolchain via the rust-toolchain file.
618
714
run : rustup show
619
715
@@ -631,6 +727,7 @@ jobs:
631
727
# Benchmarking & dashboards job
632
728
633
729
benchmark :
730
+ # We don't expect to keep being clippy-clean on nightly Rust
634
731
strategy :
635
732
# max-parallel: 1
636
733
fail-fast : false
@@ -655,6 +752,13 @@ jobs:
655
752
656
753
steps :
657
754
- uses : actions/checkout@v2
755
+ - name : Potentially override rust version with nightly
756
+ # pull_request is a fake for me to be able to test this for now
757
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
758
+ run : |
759
+ rustup override set nightly
760
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
761
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
658
762
659
763
- name : Load the default Rust toolchain via the rust-toolchain file.
660
764
run : rustup show
@@ -774,17 +878,23 @@ jobs:
774
878
775
879
steps :
776
880
- uses : actions/checkout@v2
777
-
881
+ - name : Potentially override rust version with nightly
882
+ # pull_request is a fake for me to be able to test this for now
883
+ if : " github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
884
+ run : |
885
+ rustup override set nightly
886
+ echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
887
+ echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
778
888
# Nightly is only needed for the `--profile bench` line. Once that is stabilized,
779
889
# then this line is no longer needed.
780
890
- uses : actions-rs/toolchain@v1
781
891
with :
782
- toolchain : nightly-2022-04-05
892
+ toolchain : ${{ env.INSTALLED_NIGHTLY_VERSION }}
783
893
override : true
784
894
785
895
- name : Run the example with dhat-rs to collect memory information
786
896
run : |
787
- cargo run --package icu_benchmark_memory -- --os ${{ matrix.os }} ${{ matrix.examples }} --toolchain nightly-2022-04-05
897
+ cargo run --package icu_benchmark_memory -- --os ${{ matrix.os }} ${{ matrix.examples }} --toolchain $INSTALLED_NIGHTLY_VERSION
788
898
789
899
# Benchmarking & dashboards job > (unmerged PR only) Convert benchmark output into
790
900
# dashboard HTML in a commit of a branch of the local repo.
@@ -881,8 +991,8 @@ jobs:
881
991
- name : Install prerequisites for wasm build
882
992
run : |
883
993
rustup toolchain list
884
- rustup toolchain install nightly-2022-04-05
885
- rustup component add --toolchain nightly-2022-04-05 rust-src
994
+ rustup toolchain install $INSTALLED_NIGHTLY_VERSION
995
+ rustup component add --toolchain $INSTALLED_NIGHTLY_VERSION rust-src
886
996
887
997
- name : Install Node.js v16.18.0
888
998
uses : actions/setup-node@v3
0 commit comments