1dist: xenial
2sudo: required
3
4services:
5  - docker
6
7language: cpp
8
9env:
10  matrix:
11    - OPENDHT_TEST_JOB="opendht.classic"
12    - OPENDHT_TEST_JOB="opendht.llvm"
13    - OPENDHT_TEST_JOB="opendht.proxyserver"
14    - OPENDHT_TEST_JOB="opendht.proxyclient"
15    - OPENDHT_TEST_JOB="opendht.push"
16
17before_install:
18  - |
19    # non llvm builds
20    if [[ "$OPENDHT_TEST_JOB" != *"opendht.llvm"* ]]; then
21      docker pull aberaud/opendht-deps;
22    fi
23
24  - |
25    # classic build
26    if [[ "$OPENDHT_TEST_JOB" == *"opendht.llvm"* ]]; then
27      docker pull aberaud/opendht-deps-llvm
28    fi
29
30script:
31  - |
32    # classic build
33    if [[ "$OPENDHT_TEST_JOB" == *"opendht.classic"* ]]; then
34      docker build -t opendht -f docker/DockerfileTravis .;
35    fi
36
37  - |
38    # proxy builds
39    if [[ "$OPENDHT_TEST_JOB" != *"opendht.llvm"* ]] && [[ "$OPENDHT_TEST_JOB" != *"opendht.classic"* ]]; then
40      docker build -t opendht-proxy -f docker/DockerfileTravisProxy .;
41      options='-DOPENDHT_SANITIZE=On ';
42      if [[ "$OPENDHT_TEST_JOB" == *"opendht.proxyserver"* ]] || [[ "$OPENDHT_TEST_JOB" == *"opendht.push"* ]]; then
43        options+='-DOPENDHT_PROXY_SERVER=ON ';
44      else
45        options+='-DOPENDHT_PROXY_SERVER=OFF ';
46      fi
47      if [[ "$OPENDHT_TEST_JOB" == *"opendht.proxyclient"* ]] || [[ "$OPENDHT_TEST_JOB" == *"opendht.push"* ]]; then
48        options+='-DOPENDHT_PROXY_CLIENT=ON ';
49      else
50        options+='-DOPENDHT_PROXY_CLIENT=OFF ';
51      fi
52      if [[ "$OPENDHT_TEST_JOB" == *"opendht.push"* ]]; then
53        options+='-DOPENDHT_PUSH_NOTIFICATIONS=ON ';
54      else
55        options+='-DOPENDHT_PUSH_NOTIFICATIONS=OFF ';
56      fi
57      docker run opendht-proxy /bin/sh -c "cd /root/opendht && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr -DOPENDHT_PYTHON=ON -DOPENDHT_LTO=ON -DOPENDHT_TESTS=ON $options .. && make -j8 && ./opendht_unit_tests && make install";
58    fi
59
60  - |
61    # llvm build
62    if [[ "$OPENDHT_TEST_JOB" == *"opendht.llvm"* ]]; then
63      docker build -f docker/DockerfileTravisLlvm .
64    fi
65
66notifications:
67  email:
68      - adrien.beraud@savoirfairelinux.com
69