diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6fe3a428cce..350ae132abe 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -726,42 +726,14 @@ jobs: runs-on: ubuntu-latest steps: - # Cargo-make boilerplate - - name: Get cargo-make version - id: cargo-make-version - run: | - echo "::set-output name=hash::$(cargo search cargo-make | grep '^cargo-make =' | md5sum)" - shell: bash - - name: Attempt to load cached cargo-make - uses: actions/cache@v2 - 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' - uses: actions-rs/install@v0.1.2 - with: - crate: cargo-make - version: latest + # We don't expect to keep being clippy-clean on nightly Rust, + # so the "toolchain boilerplate" is deliberately omitted - # Check if we need to force-nightly - - name: Check if we need to force-nightly - id: force_nightly - run: | - force_nightly_status=$(cargo make check-needs-force-nightly-ci) - echo "::set-output name=force_nightly_status::${force_nightly_status}" # Clippy job > Install and run clippy steps - - # We don't expect to keep being clippy-clean on nightly Rust - name: Install clippy - if: steps.force_nightly.outputs.force_nightly_status != 'true' run: rustup component add clippy - uses: actions-rs/clippy-check@v1.0.7 - if: steps.force_nightly.outputs.force_nightly_status != 'true' with: token: ${{ secrets.GITHUB_TOKEN }} # keep args in sync with `clippy-all` in .cargo/config.toml diff --git a/Makefile.toml b/Makefile.toml index b9ee009ff86..edd515fa8a3 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -186,27 +186,6 @@ if not ${env_file} exit 1 end -needs_run = exec cargo make --loglevel error check-needs-force-nightly-ci - -if eq ${needs_run} "yes" - echo "Setting up CI environment for forced-nightly Rust build" - appendfile ${env_file} "ICU4X_NIGHTLY_TOOLCHAIN=nightly\n" - appendfile ${env_file} "INSTALLED_NIGHTLY_VERSION=nightly\n" - appendfile ${env_file} "ICU4X_BUILDING_WITH_FORCED_NIGHTLY=1\n" - appendfile ${env_file} "RUSTDOCFLAGS=--cfg ICU4X_BUILDING_WITH_FORCED_NIGHTLY\n" - exec rustup override set nightly -else - echo "forced-nightly environment not required" -end -''' - -[tasks.check-needs-force-nightly-ci] -description = "Check if CI has requested a forced nightly" -category = "CI" -script_runner = "@duckscript" -script = ''' -exit_on_error true - event_name = get_env GITHUB_EVENT_NAME if not ${event_name} @@ -214,14 +193,13 @@ if not ${event_name} exit 1 end -is_schedule = eq ${event_name} "schedule" -is_pr = eq ${event_name} "pull_request" -is_dispatch = eq ${event_name} "workflow_dispatch" +is_schedule = eq "${event_name}" "schedule" +is_pr = eq "${event_name}" "pull_request" +is_dispatch = eq "${event_name}" "workflow_dispatch" dispatch_needs_nightly = set false if is_dispatch event_path = get_env GITHUB_EVENT_PATH - echo ${event_path} event_file = readfile ${event_path} event_json = json_parse ${event_file} if ${event_json.inputs.nightly} @@ -230,6 +208,13 @@ if is_dispatch end if ${is_schedule} or ${is_pr} or ${dispatch_needs_nightly} - echo "yes" + echo "Setting up CI environment for forced-nightly Rust build" + appendfile ${env_file} "ICU4X_NIGHTLY_TOOLCHAIN=nightly\n" + appendfile ${env_file} "INSTALLED_NIGHTLY_VERSION=nightly\n" + appendfile ${env_file} "ICU4X_BUILDING_WITH_FORCED_NIGHTLY=1\n" + appendfile ${env_file} "RUSTDOCFLAGS=--cfg ICU4X_BUILDING_WITH_FORCED_NIGHTLY\n" + exec rustup override set nightly +else + echo "forced-nightly environment not required" end -''' \ No newline at end of file +'''