diff --git a/.travis.yml b/.travis.yml index 2f0bb79b8f2..4c88a51590e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,10 +129,8 @@ matrix: install: - rustup target add wasm32-unknown-unknown - rustup target add wasm32-unknown-emscripten - # cargo-web takes ±10 min. to install, and cargo and cargo-update offer - # no reliable update-or-install command. We ignore updating for now - # (just drop the Travis' caches when necessary) - - cargo --list | egrep "^\s*web$" -q || cargo install cargo-web + - nvm install 9 + - ./utils/ci/install_cargo_web.sh - cargo web -V addons: chrome: stable diff --git a/utils/ci/install_cargo_web.sh b/utils/ci/install_cargo_web.sh new file mode 100755 index 00000000000..b35f0691984 --- /dev/null +++ b/utils/ci/install_cargo_web.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +CARGO_WEB_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest) +CARGO_WEB_VERSION=$(echo $CARGO_WEB_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') +CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/$CARGO_WEB_VERSION/cargo-web-x86_64-unknown-linux-gnu.gz" + +echo "Downloading cargo-web from: $CARGO_WEB_URL" +curl -L $CARGO_WEB_URL | gzip -d > cargo-web +chmod +x cargo-web + +mkdir -p ~/.cargo/bin +mv cargo-web ~/.cargo/bin