ci: Use cargo xtask to run checks

This commit is contained in:
Jonas Platte 2021-04-13 18:38:04 +02:00
parent cdcefa1e53
commit d3ef7d63ce
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
3 changed files with 8 additions and 88 deletions

View File

@ -5,16 +5,10 @@ sources:
- https://github.com/ruma/ruma
tasks:
- rustup: |
# Install stable for compiling xtask, which then uses 1.45
# We specify --profile minimal because we'd otherwise download docs
rustup toolchain install 1.45 --profile minimal
rustup default 1.45
rustup toolchain install stable,1.45 --profile minimal
rustup default stable
- test: |
# We don't want to try building ruma-signatures on 1.45, since it depends
# on ring (MSRV 'stable') and is exempt from our MSRV policy. Instead,
# 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
cd ruma
cargo xtask ci msrv

View File

@ -5,32 +5,9 @@ sources:
- https://github.com/ruma/ruma
tasks:
- rustup: |
# We specify --profile minimal because we'd otherwise download docs
rustup toolchain install nightly --profile minimal -c rustfmt,clippy
rustup default nightly
- test: |
cd ruma
# 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 ))
cargo xtask ci nightly

View File

@ -10,55 +10,4 @@ tasks:
rustup default stable
- test: |
cd ruma
# 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 \
))
cargo xtask ci stable