From d3ef7d63ce451bd92e0173e6566936838ebea387 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 13 Apr 2021 18:38:04 +0200 Subject: [PATCH] ci: Use cargo xtask to run checks --- .builds/msrv.yml | 16 +++++--------- .builds/nightly.yml | 27 ++--------------------- .builds/stable.yml | 53 +-------------------------------------------- 3 files changed, 8 insertions(+), 88 deletions(-) diff --git a/.builds/msrv.yml b/.builds/msrv.yml index 2bb3d385..8090d9f0 100644 --- a/.builds/msrv.yml +++ b/.builds/msrv.yml @@ -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 diff --git a/.builds/nightly.yml b/.builds/nightly.yml index c1db5a48..a7384875 100644 --- a/.builds/nightly.yml +++ b/.builds/nightly.yml @@ -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 diff --git a/.builds/stable.yml b/.builds/stable.yml index 331e6f80..18d3c6c9 100644 --- a/.builds/stable.yml +++ b/.builds/stable.yml @@ -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