Do less work on CI
rustfmt and clippy are now basically guaranteed to be available on Nightly, so run them unconditionally and only there.
This commit is contained in:
parent
6c8bac949e
commit
1282e1cfad
@ -6,7 +6,7 @@ sources:
|
||||
tasks:
|
||||
- rustup: |
|
||||
# We specify --profile minimal because we'd otherwise download docs
|
||||
rustup toolchain install 1.43.0 --profile minimal -c rustfmt -c clippy
|
||||
rustup toolchain install 1.43.0 --profile minimal
|
||||
rustup default 1.43.0
|
||||
- test: |
|
||||
cd ruma
|
||||
|
@ -6,7 +6,7 @@ sources:
|
||||
tasks:
|
||||
- rustup: |
|
||||
# We specify --profile minimal because we'd otherwise download docs
|
||||
rustup toolchain install beta --profile minimal -c rustfmt -c clippy
|
||||
rustup toolchain install beta --profile minimal
|
||||
rustup default beta
|
||||
- test: |
|
||||
cd ruma
|
||||
@ -15,12 +15,6 @@ tasks:
|
||||
# tools, so capture tool exit codes and set the task exit code manually
|
||||
set +e
|
||||
|
||||
cargo fmt --all -- --check
|
||||
fmt_exit=$?
|
||||
|
||||
cargo clippy --all --all-targets --all-features --quiet -- -D warnings
|
||||
clippy_exit=$?
|
||||
|
||||
cargo test --all --quiet
|
||||
test_exit=$?
|
||||
|
||||
@ -45,4 +39,4 @@ tasks:
|
||||
|
||||
popd
|
||||
|
||||
exit $(( $fmt_exit || $clippy_exit || $test_exit || $id_test_1_exit || $id_test_2_exit || $client_api_exit ))
|
||||
exit $(( $test_exit || $id_test_1_exit || $id_test_2_exit || $client_api_exit ))
|
||||
|
@ -5,13 +5,8 @@ sources:
|
||||
- https://github.com/ruma/ruma
|
||||
tasks:
|
||||
- rustup: |
|
||||
rustup toolchain install nightly --profile minimal
|
||||
rustup toolchain install nightly --profile minimal -c rustfmt,clippy
|
||||
rustup default nightly
|
||||
|
||||
# Try installing rustfmt & clippy for nightly, but don't fail the build
|
||||
# if they are not available
|
||||
rustup component add rustfmt || true
|
||||
rustup component add clippy || true
|
||||
- test: |
|
||||
cd ruma
|
||||
|
||||
@ -19,14 +14,10 @@ tasks:
|
||||
# tools, so capture tool exit codes and set the task exit code manually
|
||||
set +e
|
||||
|
||||
if ( rustup component list | grep -q rustfmt ); then
|
||||
cargo fmt --all -- --check
|
||||
fi
|
||||
cargo fmt --all -- --check
|
||||
fmt_exit=$?
|
||||
|
||||
if ( rustup component list | grep -q clippy ); then
|
||||
cargo clippy --all --all-targets --all-features --quiet -- -D warnings
|
||||
fi
|
||||
cargo clippy --all --all-targets --all-features --quiet -- -D warnings
|
||||
clippy_exit=$?
|
||||
|
||||
exit $(( $fmt_exit || $clippy_exit ))
|
||||
|
@ -6,7 +6,7 @@ sources:
|
||||
tasks:
|
||||
- rustup: |
|
||||
# We specify --profile minimal because we'd otherwise download docs
|
||||
rustup toolchain install stable --profile minimal -c rustfmt -c clippy
|
||||
rustup toolchain install stable --profile minimal
|
||||
rustup default stable
|
||||
- test: |
|
||||
cd ruma
|
||||
@ -15,12 +15,6 @@ tasks:
|
||||
# tools, so capture tool exit codes and set the task exit code manually
|
||||
set +e
|
||||
|
||||
cargo fmt --all -- --check
|
||||
fmt_exit=$?
|
||||
|
||||
cargo clippy --all --all-targets --all-features --quiet -- -D warnings
|
||||
clippy_exit=$?
|
||||
|
||||
cargo test --all --quiet
|
||||
test_exit=$?
|
||||
|
||||
@ -45,6 +39,6 @@ tasks:
|
||||
|
||||
popd
|
||||
|
||||
exit $(( $fmt_exit || $clippy_exit || $test_exit || $id_test_1_exit || $id_test_2_exit || $client_api_exit ))
|
||||
exit $(( $test_exit || $id_test_1_exit || $id_test_2_exit || $client_api_exit ))
|
||||
# TODO: Add audit task once cargo-audit binary releases are available.
|
||||
# See https://github.com/RustSec/cargo-audit/issues/66
|
||||
|
Loading…
x
Reference in New Issue
Block a user