diff --git a/.builds/beta.yml b/.builds/beta.yml new file mode 100644 index 00000000..ad2e33a7 --- /dev/null +++ b/.builds/beta.yml @@ -0,0 +1,30 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-identifiers +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-identifiers + + # 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 --no-default-features --verbose + test1_exit=$? + + cargo test --all-features --verbose + test2_exit=$? + + exit $(( $fmt_exit || $clippy_exit || $test1_exit || $test2_exit )) diff --git a/.builds/msrv.yml b/.builds/msrv.yml new file mode 100644 index 00000000..0f98a39f --- /dev/null +++ b/.builds/msrv.yml @@ -0,0 +1,26 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-identifiers +tasks: + - rustup: | + # We specify --profile minimal because we'd otherwise download docs + rustup toolchain install 1.36.0 --profile minimal + rustup default 1.36.0 + - test: | + cd ruma-identifiers + + # 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 + + # Only make sure the code builds with the MSRV. Tests can require later + # Rust versions, don't compile or run them. + cargo build --no-default-features --verbose + build1_exit=$? + + cargo build --all-features --verbose + build2_exit=$? + + exit $(( $build1_exit || $build2_exit )) diff --git a/.builds/nightly.yml b/.builds/nightly.yml new file mode 100644 index 00000000..e119912a --- /dev/null +++ b/.builds/nightly.yml @@ -0,0 +1,32 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-identifiers +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-identifiers + + # 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..57620ca8 --- /dev/null +++ b/.builds/stable.yml @@ -0,0 +1,32 @@ +image: archlinux +packages: + - rustup +sources: + - https://github.com/ruma/ruma-identifiers +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-identifiers + + # 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 --no-default-features --verbose + test1_exit=$? + + cargo test --all-features --verbose + test2_exit=$? + + exit $(( $fmt_exit || $clippy_exit || $test1_exit || $test2_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 129d203c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +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 --no-default-features --verbose - - cargo test --all-features --verbose -if: "type != push OR (tag IS blank AND branch = master)" diff --git a/README.md b/README.md index fe9daca0..34a9f2ed 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![crates.io page](https://img.shields.io/crates/v/ruma-identifiers.svg)](https://crates.io/crates/ruma-identifiers) [![docs.rs page](https://docs.rs/ruma-identifiers/badge.svg)](https://docs.rs/ruma-identifiers/) -[![build status](https://travis-ci.org/ruma/ruma-identifiers.svg?branch=master)](https://travis-ci.org/ruma/ruma-identifiers) ![license: MIT](https://img.shields.io/crates/l/ruma-identifiers.svg) **ruma-identifiers** contains types for [Matrix](https://matrix.org/) identifiers for events, rooms, room aliases, and users.