From f7d6cf9b3fe3bbafa6d1b45ee1ac9b65706000b7 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 24 Apr 2020 22:19:30 +0200 Subject: [PATCH] Replace travis CI with builds.sr.ht --- .builds/beta.yml | 27 +++++++++++++++++++++++++++ .builds/msrv.yml | 16 ++++++++++++++++ .builds/nightly.yml | 32 ++++++++++++++++++++++++++++++++ .builds/stable.yml | 29 +++++++++++++++++++++++++++++ .travis.yml | 42 ------------------------------------------ README.md | 2 -- 6 files changed, 104 insertions(+), 44 deletions(-) create mode 100644 .builds/beta.yml create mode 100644 .builds/msrv.yml create mode 100644 .builds/nightly.yml create mode 100644 .builds/stable.yml delete mode 100644 .travis.yml diff --git a/.builds/beta.yml b/.builds/beta.yml new file mode 100644 index 00000000..ec105e03 --- /dev/null +++ b/.builds/beta.yml @@ -0,0 +1,27 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-appservice-api +tasks: + - rustup: | + # We specify --profile minimal because we'd otherwise download docs + rustup toolchain install beta --profile minimal -c rustfmt -c clippy + rustup default beta + - test: | + cd ruma-appservice-api + + # 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=$? + + cargo clippy --all-targets --all-features -- -D warnings + clippy_exit=$? + + cargo test --verbose + test_exit=$? + + exit $(( $fmt_exit || $clippy_exit || $test_exit )) diff --git a/.builds/msrv.yml b/.builds/msrv.yml new file mode 100644 index 00000000..d919db99 --- /dev/null +++ b/.builds/msrv.yml @@ -0,0 +1,16 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-appservice-api +tasks: + - rustup: | + # We specify --profile minimal because we'd otherwise download docs + rustup toolchain install 1.38.0 --profile minimal + rustup default 1.38.0 + - test: | + cd ruma-appservice-api + + # Only make sure the code builds with the MSRV. Tests can require later + # Rust versions, don't compile or run them. + cargo build --verbose diff --git a/.builds/nightly.yml b/.builds/nightly.yml new file mode 100644 index 00000000..72c98254 --- /dev/null +++ b/.builds/nightly.yml @@ -0,0 +1,32 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-appservice-api +tasks: + - rustup: | + rustup toolchain install nightly --profile minimal + 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-appservice-api + + # 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 + + if ( rustup component list | grep -q rustfmt ); then + cargo fmt -- --check + fi + fmt_exit=$? + + if ( rustup component list | grep -q clippy ); then + cargo clippy --all-targets --all-features -- -D warnings + fi + clippy_exit=$? + + exit $(( $fmt_exit || $clippy_exit )) diff --git a/.builds/stable.yml b/.builds/stable.yml new file mode 100644 index 00000000..28b8f0ff --- /dev/null +++ b/.builds/stable.yml @@ -0,0 +1,29 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-appservice-api +tasks: + - rustup: | + # We specify --profile minimal because we'd otherwise download docs + rustup toolchain install stable --profile minimal -c rustfmt -c clippy + rustup default stable + - test: | + cd ruma-appservice-api + + # 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=$? + + cargo clippy --all-targets --all-features -- -D warnings + clippy_exit=$? + + cargo test --verbose + test_exit=$? + + exit $(( $fmt_exit || $clippy_exit || $test_exit )) + # TODO: Add audit task once cargo-audit binary releases are available. + # See https://github.com/RustSec/cargo-audit/issues/66 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3519fea0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: "rust" -cache: "cargo" -rust: - - 1.36.0 - - stable - - beta - - nightly -jobs: - allow_failures: - - rust: nightly - fast_finish: true - -before_script: - - rustup component add rustfmt - - | - if [ "$TRAVIS_RUST_VERSION" != "1.36.0" ]; then - rustup component add clippy - fi - - | - if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then - cargo install --force cargo-audit - fi - - cargo generate-lockfile -script: - - | - if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then - cargo audit - fi - - cargo fmt -- --check - - | - if [ "$TRAVIS_RUST_VERSION" != "1.36.0" ]; then - cargo clippy --all-targets --all-features -- -D warnings - fi - - cargo build --verbose - - cargo test --verbose -if: "type != push OR (tag IS blank AND branch = master)" -notifications: - email: false - irc: - channels: - - secure: "Z4Bo39O8Zl/xGJ3A3P08sKO12YMpQOMwwWou9oZxYGnaVQM/1hlpgMrPKtif4v+681SGMuUoA97P0Tr93oSSGqyJalN2dcft9vOiFa1Izo5nVuJ1+8trTRxV+3oE7X30ixh/jWg4oXPrfLbKMv1Bp7htjffNQQcsh2RrPjmhK3PtuqTLeY0OFm6uKIa/4fmz2d2PV+V2GRhFvI4b4HRLAQDRbFrD3MUReSqqWCpAdnyswKOVZMcCNZHuBpPdZK+lARopZsruN5LcDi787CRel79K+Cmqif1jyGgwQusjrP2c4Bjdi6SGCy2V5TNMYgYrp1ox/gLaHNC3A1aHZYmbHXI908aANbt860Y/1N0ax3CbEkUFFSfiEjnw816BTJ61/kccMEUN6nYpbj/hkyNApCXYlp65+FAx2NaQCV6obvWh7ymF3Mp8v1OvidEKbhvDqhuGQ62ZZGWVUpzKAe0QRQ2NFFPm53nOrcVHdR4ZMKdGrsgAgpvX1d92JmChqlZbEjbCZRs+KHj1Bkfwkousu9+VNLQatc+VwiqXXHnOi9jCVecqmtLnioP3UvYBEQKsh2gv5GhUwluqrSMNfy3H51Zg/lLMHQHUZw5XZgb7nenCBcrmSl4h75+z1lUdkE5UQn3WcjVOVsbwS/qpHHJ+CRKnpcSBqIE1pb0BFdI5/MU=" - use_notice: true diff --git a/README.md b/README.md index f54043e3..fc1b9d25 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # ruma-appservice-api -[![Build Status](https://travis-ci.org/ruma/ruma-appservice-api.svg?branch=master)](https://travis-ci.org/ruma/ruma-appservice-api) - **ruma-appservice-api** contains serializable types for the requests and responses for each endpoint in the [Matrix](https://matrix.org/) application service API specification. These types can be shared by application service and server code.