Skip to content

Commit ec55c77

Browse files
committed
Use precompiled cargo-web on Travis
1 parent 3c483b4 commit ec55c77

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ matrix:
130130
- rustup target add wasm32-unknown-unknown
131131
- rustup target add wasm32-unknown-emscripten
132132
- nvm install 9
133-
# cargo-web takes ±10 min. to install, and cargo and cargo-update offer
134-
# no reliable update-or-install command. We ignore updating for now
135-
# (just drop the Travis' caches when necessary)
136-
- cargo --list | egrep "^\s*web$" -q || cargo install cargo-web
133+
- ./utils/ci/install_cargo_web.sh
137134
- cargo web -V
138135
addons:
139136
chrome: stable

utils/ci/install_cargo_web.sh

Lines changed: 15 additions & 0 deletions
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)