Skip to content

Commit 0341170

Browse files
committed
fix
1 parent 74fea6e commit 0341170

File tree

2 files changed

+15
-57
lines changed

2 files changed

+15
-57
lines changed

.github/workflows/build-test.yml

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -725,43 +725,16 @@ jobs:
725725
clippy:
726726
runs-on: ubuntu-latest
727727
steps:
728+
- uses: actions/checkout@v2
728729

729-
# Cargo-make boilerplate
730-
- name: Get cargo-make version
731-
id: cargo-make-version
732-
run: |
733-
echo "::set-output name=hash::$(cargo search cargo-make | grep '^cargo-make =' | md5sum)"
734-
shell: bash
735-
- name: Attempt to load cached cargo-make
736-
uses: actions/cache@v2
737-
id: cargo-make-cache
738-
with:
739-
path: |
740-
~/.cargo/bin/cargo-make
741-
~/.cargo/bin/cargo-make.exe
742-
key: ${{ runner.os }}-make-${{ steps.cargo-make-version.outputs.hash }}
743-
- name: Install cargo-make
744-
if: steps.cargo-make-cache.outputs.cache-hit != 'true'
745-
uses: actions-rs/install@v0.1.2
746-
with:
747-
crate: cargo-make
748-
version: latest
730+
# We don't expect to keep being clippy-clean on nightly Rust,
731+
# so the "toolchain boilerplate" is deliberately omitted
749732

750-
# Check if we need to force-nightly
751-
- name: Check if we need to force-nightly
752-
id: force_nightly
753-
run: |
754-
force_nightly_status=$(cargo make check-needs-force-nightly-ci)
755-
echo "::set-output name=force_nightly_status::${force_nightly_status}"
756733
# Clippy job > Install and run clippy steps
757-
758-
# We don't expect to keep being clippy-clean on nightly Rust
759734
- name: Install clippy
760-
if: steps.force_nightly.outputs.force_nightly_status != 'true'
761735
run: rustup component add clippy
762736

763737
- uses: actions-rs/clippy-check@v1.0.7
764-
if: steps.force_nightly.outputs.force_nightly_status != 'true'
765738
with:
766739
token: ${{ secrets.GITHUB_TOKEN }}
767740
# keep args in sync with `clippy-all` in .cargo/config.toml

Makefile.toml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -186,42 +186,20 @@ if not ${env_file}
186186
exit 1
187187
end
188188
189-
needs_run = exec cargo make --loglevel error check-needs-force-nightly-ci
190-
191-
if eq ${needs_run} "yes"
192-
echo "Setting up CI environment for forced-nightly Rust build"
193-
appendfile ${env_file} "ICU4X_NIGHTLY_TOOLCHAIN=nightly\n"
194-
appendfile ${env_file} "INSTALLED_NIGHTLY_VERSION=nightly\n"
195-
appendfile ${env_file} "ICU4X_BUILDING_WITH_FORCED_NIGHTLY=1\n"
196-
appendfile ${env_file} "RUSTDOCFLAGS=--cfg ICU4X_BUILDING_WITH_FORCED_NIGHTLY\n"
197-
exec rustup override set nightly
198-
else
199-
echo "forced-nightly environment not required"
200-
end
201-
'''
202-
203-
[tasks.check-needs-force-nightly-ci]
204-
description = "Check if CI has requested a forced nightly"
205-
category = "CI"
206-
script_runner = "@duckscript"
207-
script = '''
208-
exit_on_error true
209-
210189
event_name = get_env GITHUB_EVENT_NAME
211190
212191
if not ${event_name}
213192
echo "GITHUB_EVENT_NAME not set!"
214193
exit 1
215194
end
216195
217-
is_schedule = eq ${event_name} "schedule"
218-
is_pr = eq ${event_name} "pull_request"
219-
is_dispatch = eq ${event_name} "workflow_dispatch"
196+
is_schedule = eq "${event_name}" "schedule"
197+
is_pr = eq "${event_name}" "pull_request"
198+
is_dispatch = eq "${event_name}" "workflow_dispatch"
220199
dispatch_needs_nightly = set false
221200
222201
if is_dispatch
223202
event_path = get_env GITHUB_EVENT_PATH
224-
echo ${event_path}
225203
event_file = readfile ${event_path}
226204
event_json = json_parse ${event_file}
227205
if ${event_json.inputs.nightly}
@@ -230,6 +208,13 @@ if is_dispatch
230208
end
231209
232210
if ${is_schedule} or ${is_pr} or ${dispatch_needs_nightly}
233-
echo "yes"
211+
echo "Setting up CI environment for forced-nightly Rust build"
212+
appendfile ${env_file} "ICU4X_NIGHTLY_TOOLCHAIN=nightly\n"
213+
appendfile ${env_file} "INSTALLED_NIGHTLY_VERSION=nightly\n"
214+
appendfile ${env_file} "ICU4X_BUILDING_WITH_FORCED_NIGHTLY=1\n"
215+
appendfile ${env_file} "RUSTDOCFLAGS=--cfg ICU4X_BUILDING_WITH_FORCED_NIGHTLY\n"
216+
exec rustup override set nightly
217+
else
218+
echo "forced-nightly environment not required"
234219
end
235-
'''
220+
'''

0 commit comments

Comments
 (0)