From 55840210c730f9449bca6b112e1b491a23d6dfe6 Mon Sep 17 00:00:00 2001 From: Florian Dehau Date: Sun, 6 May 2018 12:50:03 +0200 Subject: [PATCH] Simplify travis configuration --- .travis.yml | 11 +++--- Makefile | 20 ---------- scripts/tools/install.sh | 65 --------------------------------- scripts/travis/before_script.sh | 9 ----- scripts/travis/script.sh | 9 ----- 5 files changed, 5 insertions(+), 109 deletions(-) delete mode 100755 scripts/tools/install.sh delete mode 100755 scripts/travis/before_script.sh delete mode 100755 scripts/travis/script.sh diff --git a/.travis.yml b/.travis.yml index f0416a99..d7fdac2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,18 +5,17 @@ rust: - beta - nightly -env: - - NO_RUSTUP=1 - cache: cargo matrix: + fast_finish: true allow_failures: - rust: nightly - - rust: beta before_script: - - ./scripts/travis/before_script.sh + - rustup component add rustfmt-preview script: - - ./scripts/travis/script.sh + - make fmt + - make build + - make test diff --git a/Makefile b/Makefile index aa8eae18..ecfa926a 100644 --- a/Makefile +++ b/Makefile @@ -27,26 +27,6 @@ help: ## Print all the available commands awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -# ================================ Tools ====================================== - - -install-tools: install-rustfmt install-clippy ## Install tools dependencies - -INSTALL_RUSTFMT = ./scripts/tools/install.sh --name=rustfmt-nightly -ifndef CI - INSTALL_RUSTFMT += --channel=nightly -endif -install-rustfmt: ## Intall rustfmt - $(INSTALL_RUSTFMT) - -INSTALL_CLIPPY = ./scripts/tools/install.sh --name=clippy -ifndef CI - INSTALL_CLIPPY += --channel=nightly -endif -install-clippy: ## Intall rustfmt - $(INSTALL_CLIPPY) - - # =============================== Build ======================================= check: ## Validate the project code diff --git a/scripts/tools/install.sh b/scripts/tools/install.sh deleted file mode 100755 index 35ca717e..00000000 --- a/scripts/tools/install.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -set -e - -USAGE="$0 --name=STRING [--channel=STRING]" - -# Default values -CARGO="cargo" -NAME="" -CHANNEL="" - -# Parse args -for i in "$@"; do - case $i in - --name=*) - NAME="${i#*=}" - shift - ;; - --channel=*) - CHANNEL="${i#*=}" - shift - ;; - *) - echo "$USAGE" - exit 1 - ;; - esac -done - -current_version() { - local crate="$1" - $CARGO install --list | \ - grep "$crate" | \ - head -n 1 | \ - cut -d ' ' -f 2 | \ - sed 's/v\(.*\):/\1/g' -} - -upstream_version() { - local crate="$1" - $CARGO search "$crate" | \ - grep "$crate" | \ - head -n 1 | \ - cut -d' ' -f 3 | \ - sed 's/"//g' -} - -if [ "$NAME" == "" ]; then - echo "$USAGE" - exit 1 -fi - -if [ "$CHANNEL" != "" ]; then - CARGO+=" +$CHANNEL" -fi - -CURRENT_VERSION=$(current_version "$NAME") -UPSTREAM_VERSION=$(upstream_version "$NAME") - -if [[ "$CURRENT_VERSION" != "$UPSTREAM_VERSION" ]]; then - echo "WARN: Latest version of $NAME not installed: $CURRENT_VERSION -> $UPSTREAM_VERSION" - $CARGO install --force "$NAME" -else - echo "INFO: Latest version of $NAME already installed ($CURRENT_VERSION)" -fi diff --git a/scripts/travis/before_script.sh b/scripts/travis/before_script.sh deleted file mode 100755 index 20c7a579..00000000 --- a/scripts/travis/before_script.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -eu - -export PATH="$PATH:$HOME/.cargo/bin" -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - export LD_LIBRARY_PATH="$(rustc +nightly --print sysroot)/lib:${LD_LIBRARY_PATH:-""}" - make install-tools -fi diff --git a/scripts/travis/script.sh b/scripts/travis/script.sh deleted file mode 100755 index bb8c739b..00000000 --- a/scripts/travis/script.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -eu - -make build -make test -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then - make lint -fi