forked from graphql-rust/graphql-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
41 lines (41 loc) · 2.05 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
language: rust
rust:
- stable
- beta
- nightly
env:
- GRAPHQL_STYLE=false GRAPHQL_WASM=false
matrix:
include:
- rust: stable
env:
- GRAPHQL_STYLE=false
- GRAPHQL_WASM=true
- rust: beta
env:
- GRAPHQL_STYLE=true
- GRAPHQL_WASM=false
cache: cargo
addons:
firefox: latest
before_install:
- if [ "$GRAPHQL_WASM" = "true" ]; then (wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (mkdir geckodriver) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (tar -xzf geckodriver-v0.23.0-linux64.tar.gz -C geckodriver) fi
- export PATH=$PATH:$PWD/geckodriver
before_script:
- if [ "$GRAPHQL_STYLE" = "true" ]; then (sudo apt-get update) fi
- if [ "$GRAPHQL_STYLE" = "true" ]; then (sudo apt-get install -y nodejs) fi
- if [ "$GRAPHQL_STYLE" = "true" ]; then (npm i -g prettier) fi
- if [ "$GRAPHQL_STYLE" = "true" ]; then (rustup component add rustfmt clippy) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (rustup target add wasm32-unknown-unknown) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (wget https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.54/wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (mkdir wasm-bindgen) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (tar -xzf wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz -C wasm-bindgen) fi
- export PATH=$PATH:$PWD/wasm-bindgen/wasm-bindgen-0.2.54-x86_64-unknown-linux-musl
script:
- if [ "$GRAPHQL_STYLE" = "true" ]; then (cargo fmt --all -- --check) fi
- if [ "$GRAPHQL_STYLE" = "true" ]; then (cargo clippy -- -D warnings) fi
- if [ "$GRAPHQL_STYLE" = "true" ]; then (prettier --debug-check -l './**/*.json' './**/*.graphql') fi
- if [ "$GRAPHQL_STYLE" = "false" ] && [ "$GRAPHQL_WASM" = "false" ]; then (cargo test --all --tests --examples) fi
- if [ "$GRAPHQL_WASM" = "true" ]; then (xvfb-run cargo test --manifest-path=./graphql_client/Cargo.toml --features="web" --target wasm32-unknown-unknown) fi