From 3c483b422f3c6fd82f28cf9c4e6361ea80d40db0 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 7 Dec 2018 16:20:18 +0100 Subject: [PATCH 1/2] Install Node.js on Travis before running tests on `wasm32-unknown-unknown` --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2f0bb79b8f2..b90e5bcc98b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,6 +129,7 @@ matrix: install: - rustup target add wasm32-unknown-unknown - rustup target add wasm32-unknown-emscripten + - nvm install 9 # 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) From ec55c7707b8ba725be5bc0b04ae7820815b55f20 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 7 Dec 2018 16:21:47 +0100 Subject: [PATCH 2/2] Use precompiled `cargo-web` on Travis --- .travis.yml | 5 +---- utils/ci/install_cargo_web.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 utils/ci/install_cargo_web.sh diff --git a/.travis.yml b/.travis.yml index b90e5bcc98b..4c88a51590e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -130,10 +130,7 @@ matrix: - rustup target add wasm32-unknown-unknown - rustup target add wasm32-unknown-emscripten - nvm install 9 - # 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 + - ./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