Skip to content

Commit

Permalink
wip nightly cronjob CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Nov 21, 2022
1 parent b2e23de commit a46f07b
Showing 1 changed file with 132 additions and 22 deletions.
154 changes: 132 additions & 22 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ on:
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 * * *'

env:
INSTALLED_NIGHTLY_VERSION: nightly-2022-04-05

jobs:

Expand All @@ -26,6 +39,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show

Expand Down Expand Up @@ -65,6 +85,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
- name: Get cargo-make version
Expand Down Expand Up @@ -100,6 +127,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
- name: Get cargo-make version
Expand Down Expand Up @@ -145,6 +179,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
- name: Get cargo-make version
Expand Down Expand Up @@ -177,6 +218,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
- name: Attempt to load cached CLDR source data
Expand Down Expand Up @@ -227,17 +275,24 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show

- name: Load cortex target for no_std build.
run: |
rustup install nightly-2022-04-05
rustup component add --toolchain nightly-2022-04-05 rust-src
rustup target add thumbv7m-none-eabi --toolchain nightly-2022-04-05
rustup target add thumbv8m.main-none-eabihf --toolchain nightly-2022-04-05
rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2022-04-05
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-04-05
rustup install $INSTALLED_NIGHTLY_VERSION
rustup component add --toolchain $INSTALLED_NIGHTLY_VERSION rust-src
rustup target add thumbv7m-none-eabi --toolchain $INSTALLED_NIGHTLY_VERSION
rustup target add thumbv8m.main-none-eabihf --toolchain $INSTALLED_NIGHTLY_VERSION
rustup target add x86_64-unknown-linux-gnu --toolchain $INSTALLED_NIGHTLY_VERSION
rustup target add wasm32-unknown-unknown --toolchain $INSTALLED_NIGHTLY_VERSION
- name: Set up Clang-14
run: |
Expand Down Expand Up @@ -291,6 +346,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
- name: Load nightly for rustdoc-json
Expand Down Expand Up @@ -363,6 +425,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show

Expand All @@ -388,9 +457,9 @@ jobs:

- name: Load wasi for gn.
run: |
rustup install nightly-2022-04-05
rustup component add --toolchain nightly-2022-04-05 rust-src
rustup target add wasm32-wasi --toolchain nightly-2022-04-05
rustup install $INSTALLED_NIGHTLY_VERSION
rustup component add --toolchain $INSTALLED_NIGHTLY_VERSION rust-src
rustup target add wasm32-wasi --toolchain $INSTALLED_NIGHTLY_VERSION
- name: Attempt to load cached GN Third-Party Tools
uses: actions/cache@v3
Expand Down Expand Up @@ -424,6 +493,13 @@ jobs:
needs: [check]
steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
- name: Install cargo-all-features
Expand Down Expand Up @@ -465,12 +541,19 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load nightly Rust toolchain for WASM.
run: |
rustup install nightly-2022-04-05
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-04-05
rustup target add wasm32-unknown-emscripten --toolchain nightly-2022-04-05
rustup component add rust-src --toolchain nightly-2022-04-05
rustup install $INSTALLED_NIGHTLY_VERSION
rustup target add wasm32-unknown-unknown --toolchain $INSTALLED_NIGHTLY_VERSION
rustup target add wasm32-unknown-emscripten --toolchain $INSTALLED_NIGHTLY_VERSION
rustup component add rust-src --toolchain $INSTALLED_NIGHTLY_VERSION
- name: Get cargo-make version
id: cargo-make-version
Expand Down Expand Up @@ -514,7 +597,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show

Expand Down Expand Up @@ -555,7 +644,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show

Expand Down Expand Up @@ -610,10 +705,11 @@ jobs:
# Clippy job (cargo-clippy) - completes and puts warnings inline in PR
clippy:
runs-on: ubuntu-latest

# We don't expect to keep being clippy-clean on nightly Rust
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
steps:
- uses: actions/checkout@v2

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

Expand All @@ -631,6 +727,7 @@ jobs:
# Benchmarking & dashboards job

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

steps:
- uses: actions/checkout@v2
- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
- name: Load the default Rust toolchain via the rust-toolchain file.
run: rustup show
Expand Down Expand Up @@ -774,17 +878,23 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Potentially override rust version with nightly
# pull_request is a fake for me to be able to test this for now
if: "github.event_name == 'schedule' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.nightly)"
run: |
rustup override set nightly
echo "ICU4X_NIGHTLY_TOOLCHAIN=nightly" >> $GITHUB_ENV
echo "INSTALLED_NIGHTLY_VERSION=nightly" >> $GITHUB_ENV
# Nightly is only needed for the `--profile bench` line. Once that is stabilized,
# then this line is no longer needed.
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-04-05
toolchain: ${{ env.INSTALLED_NIGHTLY_VERSION }}
override: true

- name: Run the example with dhat-rs to collect memory information
run: |
cargo run --package icu_benchmark_memory -- --os ${{ matrix.os }} ${{ matrix.examples }} --toolchain nightly-2022-04-05
cargo run --package icu_benchmark_memory -- --os ${{ matrix.os }} ${{ matrix.examples }} --toolchain $INSTALLED_NIGHTLY_VERSION
# Benchmarking & dashboards job > (unmerged PR only) Convert benchmark output into
# dashboard HTML in a commit of a branch of the local repo.
Expand Down Expand Up @@ -881,8 +991,8 @@ jobs:
- name: Install prerequisites for wasm build
run: |
rustup toolchain list
rustup toolchain install nightly-2022-04-05
rustup component add --toolchain nightly-2022-04-05 rust-src
rustup toolchain install $INSTALLED_NIGHTLY_VERSION
rustup component add --toolchain $INSTALLED_NIGHTLY_VERSION rust-src
- name: Install Node.js v16.18.0
uses: actions/setup-node@v3
Expand Down

0 comments on commit a46f07b

Please sign in to comment.