diff options
-rw-r--r-- | .travis.yml | 25 | ||||
-rwxr-xr-x | .travis/bazel-linux | 25 |
2 files changed, 50 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 416aecc7..d279c4bc 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -38,6 +38,30 @@ matrix: | |||
38 | install: .travis/$JOB install | 38 | install: .travis/$JOB install |
39 | script: .travis/$JOB script | 39 | script: .travis/$JOB script |
40 | - stage: "Stage 1" | 40 | - stage: "Stage 1" |
41 | env: JOB=bazel-linux | ||
42 | compiler: clang | ||
43 | addons: | ||
44 | apt: | ||
45 | packages: | ||
46 | - libcv-dev # For av_test. | ||
47 | - libhighgui-dev # For av_test. | ||
48 | - libopencv-contrib-dev # For av_test. | ||
49 | - portaudio19-dev # For av_test. | ||
50 | before_install: | ||
51 | # Clear bazel installation. | ||
52 | - rm -rf $HOME/.cache/bazel/_bazel_$USER/install | ||
53 | # Get toktok-stack, which contains the bazel workspace. | ||
54 | - cd .. | ||
55 | - git clone https://github.com/TokTok/toktok-stack | ||
56 | - rm -rf toktok-stack/c-toxcore | ||
57 | - mv c-toxcore toktok-stack/ | ||
58 | - cd toktok-stack/c-toxcore | ||
59 | install: .travis/$JOB install | ||
60 | script: .travis/$JOB script | ||
61 | before_cache: | ||
62 | # Clear bazel installation. | ||
63 | - rm -rf $HOME/.cache/bazel/_bazel_$USER/install | ||
64 | - stage: "Stage 1" | ||
41 | if: type IN (push, api, cron) | 65 | if: type IN (push, api, cron) |
42 | env: JOB=cmake-win32 | 66 | env: JOB=cmake-win32 |
43 | services: [docker] | 67 | services: [docker] |
@@ -76,6 +100,7 @@ matrix: | |||
76 | 100 | ||
77 | cache: | 101 | cache: |
78 | directories: | 102 | directories: |
103 | - $HOME/.cache/bazel | ||
79 | - $HOME/cache | 104 | - $HOME/cache |
80 | - /opt/freebsd/cache | 105 | - /opt/freebsd/cache |
81 | 106 | ||
diff --git a/.travis/bazel-linux b/.travis/bazel-linux new file mode 100755 index 00000000..5caf2a72 --- /dev/null +++ b/.travis/bazel-linux | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ACTION="$1" | ||
4 | |||
5 | set -eu | ||
6 | |||
7 | travis_install() { | ||
8 | # Get bazel. | ||
9 | wget https://github.com/bazelbuild/bazel/releases/download/0.15.0/bazel-0.15.0-installer-linux-x86_64.sh | ||
10 | chmod +x bazel-0.15.0-installer-linux-x86_64.sh | ||
11 | ./bazel-0.15.0-installer-linux-x86_64.sh --user | ||
12 | echo 'build --jobs=4 --curses=no --verbose_failures' >> $HOME/.bazelrc | ||
13 | echo "import %workspace%/tools/bazelrc/linux-$CC" >> $HOME/.bazelrc | ||
14 | } | ||
15 | |||
16 | travis_script() { | ||
17 | # Run the tests, but if they fail, at least we should be able to build. | ||
18 | bazel test //c-toxcore/... || bazel build //c-toxcore/... | ||
19 | } | ||
20 | |||
21 | if [ "-z" "$ACTION" ]; then | ||
22 | "travis_script" | ||
23 | else | ||
24 | "travis_$ACTION" | ||
25 | fi | ||