Skip to content

Commit 19d3baf

Browse files
authored
Merge pull request #660 from koute/master
Travis improvements for running `wasm32-unknown-unknown` tests under `cargo-web`.
2 parents 6add2fd + ec55c77 commit 19d3baf

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.travis.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,8 @@ matrix:
129129
install:
130130
- rustup target add wasm32-unknown-unknown
131131
- rustup target add wasm32-unknown-emscripten
132-
# cargo-web takes ±10 min. to install, and cargo and cargo-update offer
133-
# no reliable update-or-install command. We ignore updating for now
134-
# (just drop the Travis' caches when necessary)
135-
- cargo --list | egrep "^\s*web$" -q || cargo install cargo-web
132+
- nvm install 9
133+
- ./utils/ci/install_cargo_web.sh
136134
- cargo web -V
137135
addons:
138136
chrome: stable

utils/ci/install_cargo_web.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
IFS=$'\n\t'
5+
6+
CARGO_WEB_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest)
7+
CARGO_WEB_VERSION=$(echo $CARGO_WEB_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
8+
CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/$CARGO_WEB_VERSION/cargo-web-x86_64-unknown-linux-gnu.gz"
9+
10+
echo "Downloading cargo-web from: $CARGO_WEB_URL"
11+
curl -L $CARGO_WEB_URL | gzip -d > cargo-web
12+
chmod +x cargo-web
13+
14+
mkdir -p ~/.cargo/bin
15+
mv cargo-web ~/.cargo/bin

0 commit comments

Comments
 (0)