diff options
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 90 |
1 files changed, 16 insertions, 74 deletions
diff --git a/.travis.yml b/.travis.yml index a62e8c66..527b1b79 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -1,7 +1,12 @@ | |||
1 | language: c | 1 | language: c |
2 | compiler: | 2 | compiler: |
3 | - gcc | ||
4 | - clang | 3 | - clang |
4 | - gcc | ||
5 | |||
6 | env: | ||
7 | matrix: | ||
8 | # - BUILD=hstox | ||
9 | - BUILD=toxcore | ||
5 | 10 | ||
6 | addons: | 11 | addons: |
7 | apt: | 12 | apt: |
@@ -10,90 +15,27 @@ addons: | |||
10 | packages: | 15 | packages: |
11 | - check | 16 | - check |
12 | - libvpx-dev | 17 | - libvpx-dev |
13 | - opam | 18 | - opam # For apidsl and Frama-C. |
19 | - texinfo # For libconfig. | ||
14 | 20 | ||
15 | cache: | 21 | cache: |
16 | directories: | 22 | directories: |
17 | - $HOME/cache | 23 | - $HOME/cache |
18 | 24 | ||
19 | before_script: | 25 | install: |
20 | - pushd .. | 26 | # Globally used environment variables. |
21 | - CACHE_DIR=$HOME/cache | 27 | - export CACHE_DIR=$HOME/cache |
22 | - export OPAMROOT=$CACHE_DIR/.opam | 28 | - export OPAMROOT=$CACHE_DIR/.opam |
23 | - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig | 29 | - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig |
24 | # Set up opam. | 30 | - export ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle |
25 | - opam init -y | 31 | # Install required packages. |
26 | - eval `opam config env` | 32 | - other/travis/${BUILD}-install |
27 | # Install required opam packages. | ||
28 | - opam install -y ocamlfind ppx_deriving menhir | ||
29 | # Build apidsl. | ||
30 | - git clone --depth=1 https://github.com/iphydf/apidsl | ||
31 | - make -C apidsl | ||
32 | # Install cpp-coveralls to upload test coverage results. | ||
33 | - pip install --user cpp-coveralls | ||
34 | # Install astyle (version in ubuntu-precise too old). | ||
35 | - ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle | ||
36 | - > | ||
37 | [ -f $ASTYLE ] || { | ||
38 | wget -O astyle.tar.gz http://sourceforge.net/projects/astyle/files/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz/download | ||
39 | tar -xf astyle.tar.gz -C $CACHE_DIR | ||
40 | make -C $CACHE_DIR/astyle/build/gcc | ||
41 | } | ||
42 | # Install libsodium (not in ubuntu-precise). | ||
43 | - > | ||
44 | [ -f $CACHE_DIR/lib/libsodium.a ] || { | ||
45 | git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium | ||
46 | cd libsodium | ||
47 | ./autogen.sh | ||
48 | ./configure --prefix=$CACHE_DIR | ||
49 | make install -j3 | ||
50 | cd .. | ||
51 | } | ||
52 | # Install libconfig (version in ubuntu-precise too old). | ||
53 | - > | ||
54 | [ -f $CACHE_DIR/lib/libconfig.a ] || { | ||
55 | git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig | ||
56 | cd libconfig | ||
57 | autoreconf -fi | ||
58 | ./configure --prefix=$CACHE_DIR | ||
59 | touch lib/scanner.l | ||
60 | make install -j3 | ||
61 | cd .. | ||
62 | } | ||
63 | # Install libopus (not in ubuntu-precise). | ||
64 | - > | ||
65 | [ -f $CACHE_DIR/lib/libopus.a ] || { | ||
66 | git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus | ||
67 | cd opus | ||
68 | ./autogen.sh | ||
69 | ./configure --prefix=$CACHE_DIR | ||
70 | make install -j3 | ||
71 | cd .. | ||
72 | } | ||
73 | - popd | ||
74 | 33 | ||
75 | script: | 34 | script: |
76 | # Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h. | 35 | - other/travis/${BUILD}-script |
77 | - ../apidsl/_build/apigen.native ./other/apidsl/tox.in.h | $ASTYLE --options=./other/astyle/astylerc > toxcore/tox.h | ||
78 | - ../apidsl/_build/apigen.native ./other/apidsl/toxav.in.h | $ASTYLE --options=./other/astyle/astylerc > toxav/toxav.h | ||
79 | - git diff --exit-code | ||
80 | # Build toxcore and run tests. | ||
81 | - ./autogen.sh | ||
82 | - > | ||
83 | ./configure \ | ||
84 | --with-libsodium-libs=$CACHE_DIR/lib \ | ||
85 | --with-libsodium-headers=$CACHE_DIR/include \ | ||
86 | --enable-daemon \ | ||
87 | --enable-logging \ | ||
88 | --enable-ntox \ | ||
89 | CFLAGS="-O0 -Wall -Wextra -fprofile-arcs -ftest-coverage -DTRAVIS_ENV" | ||
90 | - make | ||
91 | - make check | ||
92 | - if [ -f build/test-suite.log ]; then cat build/test-suite.log; fi | ||
93 | - make dist | ||
94 | 36 | ||
95 | after_script: | 37 | after_script: |
96 | - coveralls --exclude auto_tests --exclude other --exclude testing --gcov-options '\-lp' | 38 | - other/travis/${BUILD}-after_script |
97 | 39 | ||
98 | notifications: | 40 | notifications: |
99 | irc: "chat.freenode.net#toktok-status" | 41 | irc: "chat.freenode.net#toktok-status" |