forked from rustwasm/wasm-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
143 lines (130 loc) · 5.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
language: rust
sudo: false
matrix:
include:
# CLI builds on stable
- rust: stable
install: true
script: cargo build --manifest-path crates/cli/Cargo.toml
# Tests pass on nightly
- rust: nightly
before_install:
- rustup target add wasm32-unknown-unknown
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- source ~/.nvm/nvm.sh
- nvm install v10.5
install:
# dirties git repository, there doesn't seem to be a way to resolve this other than
# to run `npm install` twice or by using `npm ci` (which is currently broken)
- npm install
script:
- cargo test
# Check JS output from all tests against eslint
- ./node_modules/.bin/eslint ./target/generated-tests/*/out*.js
env: RUST_BACKTRACE=1
# Tests pass on nightly using yarn
- rust: nightly
before_install:
- rustup target add wasm32-unknown-unknown
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- source ~/.nvm/nvm.sh
- nvm install v10.5
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.7.0
- export PATH=$HOME/.yarn/bin:$PATH
install:
- yarn install --freeze-lockfile
script:
- cargo test
# Check JS output from all tests against eslint
- ./node_modules/.bin/eslint ./target/generated-tests/*/out*.js
env: RUST_BACKTRACE=1
# WebIDL tests pass on nightly
- rust: nightly
before_install: rustup component add rustfmt-preview --toolchain nightly
script: (cd crates/webidl && cargo test)
env: RUST_BACKTRACE=1 RUST_LOG=wasm_bindgen_webidl
# Dist linux binary
- env: TARGET=x86_64-unknown-linux-musl DEPLOY=1
rust: nightly
before_script: rustup target add $TARGET
script: cargo build --manifest-path crates/cli/Cargo.toml --release --target $TARGET
addons:
apt:
packages:
- musl-tools
# Dist OSX binary
- os: osx
rust: nightly
env: MACOSX_DEPLOYMENT_TARGET=10.7 DEPLOY=1 TARGET=x86_64-apple-darwin
script: cargo build --manifest-path crates/cli/Cargo.toml --release --target $TARGET
install: true
# We can build the tool on nightly
- rust: nightly
script: cargo install --debug --path crates/cli
# All examples work
- rust: nightly
before_install:
- rustup target add wasm32-unknown-unknown
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
- source ~/.nvm/nvm.sh
- nvm install v10.5
script:
- |
(cd examples/hello_world && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/smorgasboard && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/console_log && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/math && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/dom && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/wasm-in-wasm && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/char && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/closures && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
- |
(cd examples/comments && sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json && ./build.sh)
# Build the guide.
- rust: stable
cache:
- cargo
before_script:
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.1" mdbook)
- cargo install-update -a
script:
- (cd guide && mdbook build)
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in travis-ci.org dashboard, marked secure
local-dir: guide/book
keep-history: false
on:
branch: master
notifications:
email:
on_success: never
before_deploy:
|
if [[ "$DEPLOY" == "1" ]]; then
name="wasm-bindgen-$TRAVIS_TAG-$TARGET"
mkdir "$name"
cp "target/$TARGET/release/{wasm-bindgen,wasm2es6js}" "$name/"
cp README.md LICENSE-MIT LICENSE-APACHE "$name/"
tar czvf "$name.tar.gz" "$name"
fi
deploy:
api_key:
secure: "qCiELnEnvyKpWHDttgTNf+ElZGbWlvthu5aOIj5nYfov+h6g1+mkWnDFP6at/WPlE78zE/f/z/dL2KB2I7w/cxH/T4P1nWh0A9DvrpY6hqWkK2pgN5dPeWE/a4flI7AdH0A6wMRw7m00uMgDjlzN78v7XueccpJCxSO5allQN5jweAQvMX2QA07TbLRJc7Lq6lfVwSf8OfrcO8qCbcIzJTsC4vtbh6jkUYg1OAaU2tAYlskBy9ZYmHWCExIAu/zxzcJY9OpApPD9Ea4CyrsfjniAyRBJ87Weh/sP4XhiWeRPVmvA4HAzv4Pps9ps+Ar5QmsX53rhKQ3id7/VPR8ggaAHxrYUiJPvJRtbP6cKKOlDiK0ooP+vI4vjxWeNVj9ibEolSYOlT0ENIvPK1BppA6VgAoJOjwPr0Q16Ma4AmvLkIkowJiXCm2Jlje/5c0vPEAGJVgUtkj3jFQzgXwyEMpzxUlhHmYpmnfeaM0tK/Kiiwe1monL/ydMlyfV55kNylylCg+XoTnf420AFChKbD4DM5Z7ZsjU9g8fF3LUoN0sKpmLDp+GvwjLi9YtGogWB71Q2MFp43MSL0YLshkyYYoZKrVMiy5J9hKNUxhT2jNEq53Z69syIHHMCxHL9GoAcuHxIKOA7uTMW0aCoyy2I+dfAKKsrUGwGYaNC5LZdUQI="
file_glob: true
file:
- wasm-bindgen-$TRAVIS_TAG-$TARGET.tar.gz
on:
condition: $DEPLOY = 1
tags: true
provider: releases
skip_cleanup: true