mirror of
https://github.com/bspeice/dtparse
synced 2024-12-21 20:08:10 -05:00
Test adding WASM support
This commit is contained in:
parent
0ef35527d9
commit
22e0300275
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ Cargo.lock
|
|||||||
.vscode
|
.vscode
|
||||||
*.pyc
|
*.pyc
|
||||||
.idea/
|
.idea/
|
||||||
|
*.swp
|
||||||
|
@ -5,6 +5,8 @@ dist: trusty
|
|||||||
language: rust
|
language: rust
|
||||||
services: docker
|
services: docker
|
||||||
sudo: required
|
sudo: required
|
||||||
|
addons:
|
||||||
|
chrome: stable
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
@ -90,6 +92,10 @@ matrix:
|
|||||||
- env: TARGET=x86_64-unknown-linux-gnu
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
rust: 1.27.0
|
rust: 1.27.0
|
||||||
|
|
||||||
|
# WASM support
|
||||||
|
- env: TARGET=asmjs-unknown-empscripten USE_CARGO_WEB=true
|
||||||
|
rust: nightly
|
||||||
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- set -e
|
- set -e
|
||||||
|
@ -20,4 +20,4 @@ name = "dtparse"
|
|||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
lazy_static = "1.1"
|
lazy_static = "1.1"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
rust_decimal = "0.10"
|
rust_decimal = "^0.10.1"
|
||||||
|
20
ci/script.sh
20
ci/script.sh
@ -14,7 +14,27 @@ main() {
|
|||||||
cross test --target $TARGET --release
|
cross test --target $TARGET --release
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main_web() {
|
||||||
|
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
|
||||||
|
|
||||||
|
cargo web build --target $TARGET
|
||||||
|
cargo web test --target $TARGET --release
|
||||||
|
}
|
||||||
|
|
||||||
# we don't run the "test phase" when doing deploys
|
# we don't run the "test phase" when doing deploys
|
||||||
if [ -z $TRAVIS_TAG ]; then
|
if [ -z $TRAVIS_TAG ]; then
|
||||||
|
if [ -z "$USE_CARGO_WEB" ]; then
|
||||||
main
|
main
|
||||||
|
else
|
||||||
|
main_web
|
||||||
|
fi
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user