Skip to content

Commit 4e190fc

Browse files
committed
wip nightly cronjob CI
1 parent b2e23de commit 4e190fc

File tree

1 file changed

+132
-22
lines changed

1 file changed

+132
-22
lines changed

.github/workflows/build-test.yml

Lines changed: 132 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ on:
1818
branches: [ main ]
1919
pull_request:
2020
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
2134

2235
jobs:
2336

@@ -26,6 +39,13 @@ jobs:
2639
runs-on: ubuntu-latest
2740
steps:
2841
- 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
2949
- name: Load the default Rust toolchain via the rust-toolchain file.
3050
run: rustup show
3151

@@ -65,6 +85,13 @@ jobs:
6585

6686
steps:
6787
- 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
6895
- name: Load the default Rust toolchain via the rust-toolchain file.
6996
run: rustup show
7097
- name: Get cargo-make version
@@ -100,6 +127,13 @@ jobs:
100127

101128
steps:
102129
- 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
103137
- name: Load the default Rust toolchain via the rust-toolchain file.
104138
run: rustup show
105139
- name: Get cargo-make version
@@ -145,6 +179,13 @@ jobs:
145179
runs-on: ubuntu-latest
146180
steps:
147181
- 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
148189
- name: Load the default Rust toolchain via the rust-toolchain file.
149190
run: rustup show
150191
- name: Get cargo-make version
@@ -177,6 +218,13 @@ jobs:
177218
runs-on: ubuntu-latest
178219
steps:
179220
- 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
180228
- name: Load the default Rust toolchain via the rust-toolchain file.
181229
run: rustup show
182230
- name: Attempt to load cached CLDR source data
@@ -227,17 +275,24 @@ jobs:
227275

228276
steps:
229277
- 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
230285
- name: Load the default Rust toolchain via the rust-toolchain file.
231286
run: rustup show
232287

233288
- name: Load cortex target for no_std build.
234289
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
241296
242297
- name: Set up Clang-14
243298
run: |
@@ -291,6 +346,13 @@ jobs:
291346

292347
steps:
293348
- 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
294356
- name: Load the default Rust toolchain via the rust-toolchain file.
295357
run: rustup show
296358
- name: Load nightly for rustdoc-json
@@ -363,6 +425,13 @@ jobs:
363425

364426
steps:
365427
- 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
366435
- name: Load the default Rust toolchain via the rust-toolchain file.
367436
run: rustup show
368437

@@ -388,9 +457,9 @@ jobs:
388457

389458
- name: Load wasi for gn.
390459
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
394463
395464
- name: Attempt to load cached GN Third-Party Tools
396465
uses: actions/cache@v3
@@ -424,6 +493,13 @@ jobs:
424493
needs: [check]
425494
steps:
426495
- 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
427503
- name: Load the default Rust toolchain via the rust-toolchain file.
428504
run: rustup show
429505
- name: Install cargo-all-features
@@ -465,12 +541,19 @@ jobs:
465541

466542
steps:
467543
- 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
468551
- name: Load nightly Rust toolchain for WASM.
469552
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
474557
475558
- name: Get cargo-make version
476559
id: cargo-make-version
@@ -514,7 +597,13 @@ jobs:
514597
runs-on: ubuntu-latest
515598
steps:
516599
- 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
518607
- name: Load the default Rust toolchain via the rust-toolchain file.
519608
run: rustup show
520609

@@ -555,7 +644,13 @@ jobs:
555644
runs-on: ubuntu-latest
556645
steps:
557646
- 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
559654
- name: Load the default Rust toolchain via the rust-toolchain file.
560655
run: rustup show
561656

@@ -610,10 +705,11 @@ jobs:
610705
# Clippy job (cargo-clippy) - completes and puts warnings inline in PR
611706
clippy:
612707
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)"
614710
steps:
615-
- uses: actions/checkout@v2
616711

712+
- uses: actions/checkout@v2
617713
- name: Load the default Rust toolchain via the rust-toolchain file.
618714
run: rustup show
619715

@@ -631,6 +727,7 @@ jobs:
631727
# Benchmarking & dashboards job
632728

633729
benchmark:
730+
# We don't expect to keep being clippy-clean on nightly Rust
634731
strategy:
635732
# max-parallel: 1
636733
fail-fast: false
@@ -655,6 +752,13 @@ jobs:
655752

656753
steps:
657754
- 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
658762
659763
- name: Load the default Rust toolchain via the rust-toolchain file.
660764
run: rustup show
@@ -774,17 +878,23 @@ jobs:
774878

775879
steps:
776880
- 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
778888
# Nightly is only needed for the `--profile bench` line. Once that is stabilized,
779889
# then this line is no longer needed.
780890
- uses: actions-rs/toolchain@v1
781891
with:
782-
toolchain: nightly-2022-04-05
892+
toolchain: ${{ env.INSTALLED_NIGHTLY_VERSION }}
783893
override: true
784894

785895
- name: Run the example with dhat-rs to collect memory information
786896
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
788898
789899
# Benchmarking & dashboards job > (unmerged PR only) Convert benchmark output into
790900
# dashboard HTML in a commit of a branch of the local repo.
@@ -881,8 +991,8 @@ jobs:
881991
- name: Install prerequisites for wasm build
882992
run: |
883993
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
886996
887997
- name: Install Node.js v16.18.0
888998
uses: actions/setup-node@v3

0 commit comments

Comments
 (0)