run clippy on CI
This commit is contained in:
parent
92c2e3c0bc
commit
bd7f83dc37
55
.github/workflows/ci.yml
vendored
55
.github/workflows/ci.yml
vendored
@ -72,20 +72,10 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ${{ github.event_name }} == 'schedule' ]]; then
|
||||
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
|
||||
./rustup-toolchain HEAD --host ${{ matrix.host_target }}
|
||||
else
|
||||
RUSTC_HASH=$(< rust-version)
|
||||
./rustup-toolchain "" --host ${{ matrix.host_target }}
|
||||
fi
|
||||
# We need a nightly cargo for parts of the cargo miri test suite.
|
||||
rustup-toolchain-install-master \
|
||||
-f \
|
||||
-n master "$RUSTC_HASH" \
|
||||
-c cargo \
|
||||
-c rust-src \
|
||||
-c rustc-dev \
|
||||
-c llvm-tools \
|
||||
--host ${{ matrix.host_target }}
|
||||
rustup default master
|
||||
|
||||
- name: Show Rust version
|
||||
run: |
|
||||
@ -97,26 +87,35 @@ jobs:
|
||||
run: bash ./ci.sh
|
||||
|
||||
fmt:
|
||||
name: check formatting (ignored by bors)
|
||||
name: formatting (ignored by bors)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install latest nightly
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
default: true
|
||||
- name: Check formatting (miri)
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
- name: Check formatting (cargo-miri)
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path cargo-miri/Cargo.toml --all -- --check
|
||||
run: |
|
||||
rustup toolchain install nightly --component rustfmt
|
||||
rustup override set nightly
|
||||
- name: Formatting (miri, ui_test)
|
||||
run: cargo fmt --all --check
|
||||
- name: Formatting (cargo-miri)
|
||||
run: cargo fmt --manifest-path cargo-miri/Cargo.toml --all --check
|
||||
|
||||
clippy:
|
||||
name: clippy (ignored by bors)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install required toolchain
|
||||
# We need a toolchain that can actually build Miri, just a nightly won't do.
|
||||
run: |
|
||||
cargo install rustup-toolchain-install-master # TODO: cache this?
|
||||
./rustup-toolchain "" -c clippy
|
||||
- name: Clippy (miri)
|
||||
run: cargo clippy --all-targets -- -D warnings
|
||||
#- name: Clippy (ui_test)
|
||||
# run: cargo clippy --manifest-path ui_test/Cargo.toml --all-targets -- -D warnings
|
||||
- name: Clippy (cargo-miri)
|
||||
run: cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings
|
||||
|
||||
# These jobs doesn't actually test anything, but they're only used to tell
|
||||
# bors the build completed, as there is no practical way to detect when a
|
||||
|
@ -12,6 +12,8 @@ set -e
|
||||
# ./rustup-toolchain HEAD: Update "miri" toolchain and `rust-version` file to latest rustc HEAD.
|
||||
#
|
||||
# ./rustup-toolchain $COMMIT: Update "miri" toolchain and `rust-version` file to match that commit.
|
||||
#
|
||||
# Any extra parameters are passed to `rustup-toolchain-install-master`.
|
||||
|
||||
# Make sure rustup-toolchain-install-master is installed.
|
||||
if ! which rustup-toolchain-install-master >/dev/null; then
|
||||
@ -28,6 +30,7 @@ else
|
||||
NEW_COMMIT="$1"
|
||||
fi
|
||||
echo "$NEW_COMMIT" > rust-version
|
||||
shift
|
||||
|
||||
# Check if we already are at that commit.
|
||||
CUR_COMMIT=$(rustc +miri --version -v 2>/dev/null | egrep "^commit-hash: " | cut -d " " -f 2)
|
||||
@ -39,7 +42,7 @@ fi
|
||||
|
||||
# Install and setup new toolchain.
|
||||
rustup toolchain uninstall miri
|
||||
rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -- "$NEW_COMMIT"
|
||||
rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools "$@" -- "$NEW_COMMIT"
|
||||
rustup override set miri
|
||||
|
||||
# Cleanup.
|
||||
|
Loading…
Reference in New Issue
Block a user