ci: Use cargo xtask to run checks
This commit is contained in:
parent
cdcefa1e53
commit
d3ef7d63ce
@ -5,16 +5,10 @@ sources:
|
|||||||
- https://github.com/ruma/ruma
|
- https://github.com/ruma/ruma
|
||||||
tasks:
|
tasks:
|
||||||
- rustup: |
|
- rustup: |
|
||||||
|
# Install stable for compiling xtask, which then uses 1.45
|
||||||
# We specify --profile minimal because we'd otherwise download docs
|
# We specify --profile minimal because we'd otherwise download docs
|
||||||
rustup toolchain install 1.45 --profile minimal
|
rustup toolchain install stable,1.45 --profile minimal
|
||||||
rustup default 1.45
|
rustup default stable
|
||||||
- test: |
|
- test: |
|
||||||
# We don't want to try building ruma-signatures on 1.45, since it depends
|
cd ruma
|
||||||
# on ring (MSRV 'stable') and is exempt from our MSRV policy. Instead,
|
cargo xtask ci msrv
|
||||||
# enable all other dependencies on the ruma crate and try building that
|
|
||||||
# (usually you would enable the higher-level features, but we're only
|
|
||||||
# doing this to have all relevant crates compiled, no to build a useful
|
|
||||||
# crate).
|
|
||||||
cd ruma/ruma
|
|
||||||
|
|
||||||
cargo build --features full --quiet
|
|
||||||
|
@ -5,32 +5,9 @@ sources:
|
|||||||
- https://github.com/ruma/ruma
|
- https://github.com/ruma/ruma
|
||||||
tasks:
|
tasks:
|
||||||
- rustup: |
|
- rustup: |
|
||||||
|
# We specify --profile minimal because we'd otherwise download docs
|
||||||
rustup toolchain install nightly --profile minimal -c rustfmt,clippy
|
rustup toolchain install nightly --profile minimal -c rustfmt,clippy
|
||||||
rustup default nightly
|
rustup default nightly
|
||||||
- test: |
|
- test: |
|
||||||
cd ruma
|
cd ruma
|
||||||
|
cargo xtask ci nightly
|
||||||
# We don't want the build to stop on individual failure of independent
|
|
||||||
# tools, so capture tool exit codes and set the task exit code manually
|
|
||||||
set +e
|
|
||||||
|
|
||||||
cargo fmt -- --check
|
|
||||||
fmt_exit=$?
|
|
||||||
|
|
||||||
pushd ruma
|
|
||||||
|
|
||||||
cargo clippy --all-targets --all-features --quiet -- -D warnings
|
|
||||||
clippy_1_exit=$?
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
# Need to run clippy separately on ruma-client to not enable conflicting
|
|
||||||
# features with --all-features.
|
|
||||||
pushd ruma-client
|
|
||||||
|
|
||||||
cargo clippy --all-targets --quiet -- -D warnings
|
|
||||||
clippy_2_exit=$?
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
exit $(( $fmt_exit || $clippy_1_exit || $clippy_2_exit ))
|
|
||||||
|
@ -10,55 +10,4 @@ tasks:
|
|||||||
rustup default stable
|
rustup default stable
|
||||||
- test: |
|
- test: |
|
||||||
cd ruma
|
cd ruma
|
||||||
|
cargo xtask ci stable
|
||||||
# We don't want the build to stop on individual failure of independent
|
|
||||||
# tools, so capture tool exit codes and set the task exit code manually
|
|
||||||
set +e
|
|
||||||
|
|
||||||
cargo test --workspace --quiet
|
|
||||||
test_exit=$?
|
|
||||||
|
|
||||||
# ruma-identifiers has a bunch of features. Make sure it works both with
|
|
||||||
# all of them and none of them being enabled.
|
|
||||||
pushd ruma-identifiers
|
|
||||||
|
|
||||||
cargo test --no-default-features --quiet
|
|
||||||
id_test_1_exit=$?
|
|
||||||
|
|
||||||
cargo test --all-features --quiet
|
|
||||||
id_test_2_exit=$?
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
# ruma-client_api also has a few optional features, but none are enabled
|
|
||||||
# by default. Make sure it works with all of them.
|
|
||||||
pushd ruma-client-api
|
|
||||||
|
|
||||||
cargo test --all-features --quiet
|
|
||||||
client_api_exit=$?
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
# Test non-default configurations of ruma-client
|
|
||||||
pushd ruma-client
|
|
||||||
|
|
||||||
cargo check --no-default-features --features http1,http2 --quiet
|
|
||||||
client_1_exit=$?
|
|
||||||
|
|
||||||
cargo check --no-default-features --features http1,http2,tls-rustls-native-roots --quiet
|
|
||||||
client_2_exit=$?
|
|
||||||
|
|
||||||
cargo check --no-default-features --features http1,http2,tls-rustls-webpki-roots --quiet
|
|
||||||
client_3_exit=$?
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
exit $(( \
|
|
||||||
$test_exit \
|
|
||||||
|| $id_test_1_exit \
|
|
||||||
|| $id_test_2_exit \
|
|
||||||
|| $client_api_exit \
|
|
||||||
|| $client_1_exit \
|
|
||||||
|| $client_2_exit \
|
|
||||||
|| $client_3_exit \
|
|
||||||
))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user