|
1 | | -branches: |
2 | | - only: |
3 | | - # This is where pull requests from "bors r+" are built. |
4 | | - - staging |
5 | | - # This is where pull requests from "bors try" are built. |
6 | | - - trying |
7 | | - # Enable building pull requests. |
8 | | - - master |
| 1 | +sudo: false |
9 | 2 |
|
10 | 3 | language: rust |
11 | | -sudo: false |
| 4 | +os: |
| 5 | + - linux |
| 6 | + # - windows # TODO: https://github.com/pingcap/kvproto/issues/355 |
| 7 | + - osx |
| 8 | +rust: |
| 9 | + - stable |
| 10 | + - nightly |
12 | 11 | env: |
13 | 12 | global: |
14 | 13 | - RUST_BACKTRACE=1 |
15 | 14 | - RUSTFLAGS="-D warnings" |
16 | | -cache: cargo |
17 | | - |
18 | | -rust: |
19 | | -os: |
20 | | - - linux |
21 | | - - windows |
22 | | - - osx |
23 | 15 |
|
24 | | -matrix: |
25 | | - include: |
26 | | - # This build uses stable and checks rustfmt and clippy. |
27 | | - # We don't check them on nightly since their lints and formatting may differ. |
28 | | - - rust: stable |
29 | | - install: |
30 | | - - rustup component add rustfmt-preview |
31 | | - - rustup component add clippy-preview |
32 | | - before_script: |
33 | | - - cargo fmt --all -- --check |
34 | | - - cargo clippy --all -- -D clippy |
35 | | - # Since many users will use nightlies, also test that. |
36 | | - - rust: nightly |
| 16 | +addons: |
| 17 | + apt: |
| 18 | + update: true |
| 19 | + sources: |
| 20 | + - sourceline: 'ppa:maarten-fonville/protobuf' |
| 21 | + packages: |
| 22 | + - protobuf-compiler |
| 23 | + homebrew: |
| 24 | + packages: |
| 25 | + - protobuf |
| 26 | + - cmake |
| 27 | + - go |
37 | 28 |
|
| 29 | +install: |
| 30 | + - if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then rustup component add rustfmt; fi |
| 31 | + - if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then rustup component add clippy; fi |
| 32 | + - if [[ $TRAVIS_OS_NAME == "windows" ]]; then choco install golang cmake strawberryperl protoc; fi |
| 33 | + - if [[ $TRAVIS_OS_NAME == "windows" ]]; then export PATH="$PATH:/c/Go/bin/:/c/Program Files/CMake/bin"; fi |
38 | 34 |
|
39 | 35 | script: |
40 | | - - docker run -d --net=host --name pd --rm pingcap/pd --name "pd" --data-dir "pd" --client-urls "http://127.0.0.1:2379" --advertise-client-urls "http://127.0.0.1:2379" |
41 | | - - docker run -d --net=host --name kv --rm pingcap/tikv --pd-endpoints "127.0.0.1:2379" --addr "127.0.0.1:2378" --data-dir "kv" |
| 36 | + - if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo fmt -- --check; fi |
| 37 | + - if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy -- -D clippy::all; fi |
42 | 38 | - cargo test --all -- --nocapture |
43 | | - # Validate benches still work. |
44 | | - - cargo bench --all -- --test |
| 39 | + # For now we only run full integration tests on Linux. Here's why: |
| 40 | + # * Docker on OS X is not supported by Travis. |
| 41 | + # * Docker on Windows seems to not have the correct binary at `"/c/Program Files/Docker/Docker/DockerCli.exe" to switch it to Linux containers. |
| 42 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker run -d --net=host --name pd --rm pingcap/pd --name "pd" --data-dir "pd" --client-urls "http://127.0.0.1:2379" --advertise-client-urls "http://127.0.0.1:2379"; fi |
| 43 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker run -d --net=host --name kv --rm --ulimit nofile=90000:90000 pingcap/tikv --pd-endpoints "127.0.0.1:2379" --addr "127.0.0.1:2378" --data-dir "kv"; fi |
| 44 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker ps; fi |
| 45 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker logs pd; fi |
| 46 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker logs kv; fi |
| 47 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then PD_ADDR="127.0.0.1:2379" cargo test --all --features integration-tests -- --nocapture; fi |
0 commit comments