Skip to content

Commit bd7f83d

Browse files
committed
run clippy on CI
1 parent 92c2e3c commit bd7f83d

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,10 @@ jobs:
7272
shell: bash
7373
run: |
7474
if [[ ${{ github.event_name }} == 'schedule' ]]; then
75-
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
75+
./rustup-toolchain HEAD --host ${{ matrix.host_target }}
7676
else
77-
RUSTC_HASH=$(< rust-version)
77+
./rustup-toolchain "" --host ${{ matrix.host_target }}
7878
fi
79-
# We need a nightly cargo for parts of the cargo miri test suite.
80-
rustup-toolchain-install-master \
81-
-f \
82-
-n master "$RUSTC_HASH" \
83-
-c cargo \
84-
-c rust-src \
85-
-c rustc-dev \
86-
-c llvm-tools \
87-
--host ${{ matrix.host_target }}
88-
rustup default master
8979
9080
- name: Show Rust version
9181
run: |
@@ -97,26 +87,35 @@ jobs:
9787
run: bash ./ci.sh
9888

9989
fmt:
100-
name: check formatting (ignored by bors)
90+
name: formatting (ignored by bors)
10191
runs-on: ubuntu-latest
10292
steps:
10393
- uses: actions/checkout@v3
10494
- name: Install latest nightly
105-
uses: actions-rs/toolchain@v1
106-
with:
107-
toolchain: nightly
108-
components: rustfmt
109-
default: true
110-
- name: Check formatting (miri)
111-
uses: actions-rs/cargo@v1
112-
with:
113-
command: fmt
114-
args: --all -- --check
115-
- name: Check formatting (cargo-miri)
116-
uses: actions-rs/cargo@v1
117-
with:
118-
command: fmt
119-
args: --manifest-path cargo-miri/Cargo.toml --all -- --check
95+
run: |
96+
rustup toolchain install nightly --component rustfmt
97+
rustup override set nightly
98+
- name: Formatting (miri, ui_test)
99+
run: cargo fmt --all --check
100+
- name: Formatting (cargo-miri)
101+
run: cargo fmt --manifest-path cargo-miri/Cargo.toml --all --check
102+
103+
clippy:
104+
name: clippy (ignored by bors)
105+
runs-on: ubuntu-latest
106+
steps:
107+
- uses: actions/checkout@v3
108+
- name: Install required toolchain
109+
# We need a toolchain that can actually build Miri, just a nightly won't do.
110+
run: |
111+
cargo install rustup-toolchain-install-master # TODO: cache this?
112+
./rustup-toolchain "" -c clippy
113+
- name: Clippy (miri)
114+
run: cargo clippy --all-targets -- -D warnings
115+
#- name: Clippy (ui_test)
116+
# run: cargo clippy --manifest-path ui_test/Cargo.toml --all-targets -- -D warnings
117+
- name: Clippy (cargo-miri)
118+
run: cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings
120119

121120
# These jobs doesn't actually test anything, but they're only used to tell
122121
# bors the build completed, as there is no practical way to detect when a

rustup-toolchain

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ set -e
1212
# ./rustup-toolchain HEAD: Update "miri" toolchain and `rust-version` file to latest rustc HEAD.
1313
#
1414
# ./rustup-toolchain $COMMIT: Update "miri" toolchain and `rust-version` file to match that commit.
15+
#
16+
# Any extra parameters are passed to `rustup-toolchain-install-master`.
1517

1618
# Make sure rustup-toolchain-install-master is installed.
1719
if ! which rustup-toolchain-install-master >/dev/null; then
@@ -28,6 +30,7 @@ else
2830
NEW_COMMIT="$1"
2931
fi
3032
echo "$NEW_COMMIT" > rust-version
33+
shift
3134

3235
# Check if we already are at that commit.
3336
CUR_COMMIT=$(rustc +miri --version -v 2>/dev/null | egrep "^commit-hash: " | cut -d " " -f 2)
@@ -39,7 +42,7 @@ fi
3942

4043
# Install and setup new toolchain.
4144
rustup toolchain uninstall miri
42-
rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -- "$NEW_COMMIT"
45+
rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools "$@" -- "$NEW_COMMIT"
4346
rustup override set miri
4447

4548
# Cleanup.

0 commit comments

Comments
 (0)