aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: f0567e5909a0e33ce2a362bd076aff27fcc72ef9 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Copyright (c) 2016, Linaro Limited
# All rights reserved.
# SPDX-License-Identifier:     BSD-3-Clause
#
# Please update xxxx for your coverity token and notification email if required
# pushing to github/master will run make check
# pushing to github/coverity_scan will also launch a static analysis
# See https://scan.coverity.com/travis_ci

language: c
sudo: required
dist: trusty
group: deprecated-2017Q2
env:
  global:
    # COVERITY_SCAN_TOKEN
    # ** specific to your project **
    # Note:
    # You should have a github account and travis linked travis account.
    # The secure key to be filled below is the 685 character long encrypted
    # token you can find as follow from your coverity dashboard
    # (at https://scan.coverity.com/dashboard):
    # Click on the github project (<you>/odp)
    # Click on "submit build"
    # Click on "Configure Travis CI"
    # Look at the COVERITY_SCAN_TOKEN in the env: global: section
    # of the configuration example.
    # copy the secure:<key> below
    #
    - secure: "xxxx"
    #
    # By default Linaro CODECOV_TOKEN token is used. It's ok to use it to see
    # for individual commit validation. But you you want to track tests history
    # you need generated new one at https://codecov.io specific for your repo.
    - CODECOV_TOKEN=8e1c0fd8-62ff-411e-a79f-5839f6662c11

addons:
        apt:
                sources:
                        - ubuntu-toolchain-r-test
                packages:
                        - gcc
                        - clang-3.8
                        - automake autoconf libtool libssl-dev graphviz mscgen doxygen
                        - libpcap-dev
                        - dpkg-cross equivs
                        - gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu libc6-dev-arm64-cross
                        - gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf libc6-dev-armhf-cross
                        - gcc-powerpc-linux-gnu pkg-config-powerpc-linux-gnu libc6-dev-powerpc-cross
#        coverity_scan:
#                project:
#                        name: "$TRAVIS_REPO_SLUG"
#                        notification_email: xxxx
#                        build_command_prepend: "./bootstrap && ./configure --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example"
#                        build_command:   "make"
#                        branch_pattern: coverity_scan

compiler:
        - gcc
        - clang-3.8

env:
        - CONF=""
        - CONF="--disable-abi-compat"
        - CONF="--enable-schedule-sp"
        - CONF="--enable-schedule-iquery"

before_install:
#       Install cunit for the validation tests because distro version is too old and fails C99 compile
        - sudo apt-get remove libcunit1-dev libcunit1
        - export CUNIT_VERSION=2.1-3
        - curl -sSOL https://github.com/Linaro/libcunit/releases/download/${CUNIT_VERSION}/CUnit-${CUNIT_VERSION}.tar.bz2
        - tar -jxf *.bz2
        - pushd CUnit*
        - libtoolize --force --copy
        - aclocal
        - autoheader
        - automake --add-missing --include-deps --copy
        - autoconf
        - ./configure --enable-debug --enable-automated --enable-basic --enable-console --enable-examples --enable-test $CROSS || cat config.log
        - make
        - sudo make install
        - popd
        - export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

install:
        - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages
        - sudo mkdir -p /mnt/huge
        - sudo mount -t hugetlbfs nodev /mnt/huge

        - sudo apt-get -qq update
        - sudo apt-get install linux-headers-`uname -r`
        - sudo pip install coverage
        - gem install asciidoctor
        - PATH=${PATH//:\.\/node_modules\/\.bin/}

#	DPDK pktio
        - TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
        - git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v17.02 http://dpdk.org/git/dpdk dpdk
        - pushd dpdk
        - git log --oneline --decorate
        - make config T=${TARGET} O=${TARGET}
        - pushd ${TARGET}
        - sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
        - popd
        - make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
        - popd

#	Netmap pktio
        - git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v11.2 https://github.com/luigirizzo/netmap.git
        - pushd netmap/LINUX
        - ./configure
        - make
        - sudo insmod ./netmap.ko
        - popd

script:
        - ./bootstrap
        - ./configure --prefix=$HOME/odp-install  --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap $CONF
        - make -j $(nproc)
        - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make check
        - make install

        - echo "Checking linking and run from install..."
        - pushd $HOME
        - echo "Dynamic link.."
        - ${CC} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst -I${HOME}/odp-install/include -L${HOME}/odp-install/lib -lodp-linux -L${OLDPWD}/dpdk/x86_64-native-linuxapp-gcc/lib -lrt -ldpdk -lpthread -lcrypto -lpcap -ldl
        - LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst
        - echo "Static link.."
        - ${CC} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst -I${HOME}/odp-install/include -L${HOME}/odp-install/lib -lodp-linux -L${OLDPWD}/dpdk/x86_64-native-linuxapp-gcc/lib -lrt -ldpdk -lpthread -lcrypto -lpcap -ldl -static
        - ./odp_hello_inst

jobs:
        include:
                - stage: test
                  compiler: aarch64-linux-gnu-gcc
                  env: TEST="aarch64-linux-gnu" CROSS="--host=aarch64-linux-gnu --prefix=/usr/aarch64-linux-gnu"
                  install: true
                  script:
                          - mkdir cross
                          - pushd cross
                            # one can not include colon in the command or bad things will happen, so mimic it
                          - env echo -e 'Provides\x3a multiarch-support, debconf, debconf-2.0' > dummy
                          - equivs-build -a arm64 dummy
                          - wget
                            http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.0.1f-1ubuntu2.22_arm64.deb
                            http://ports.ubuntu.com/pool/main/o/openssl/libssl1.0.0_1.0.1f-1ubuntu2.22_arm64.deb
                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-1ubuntu1_arm64.deb
                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-1ubuntu1_arm64.deb
                          - sudo dpkg-cross -i -M -A -a arm64 *.deb
                          - popd
                          - ./bootstrap
                          - ./configure --prefix=$HOME/odp-install $CROSS
                            --disable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-test-perf-proc --enable-test-example
                          - make -j $(nproc)
                - stage: test
                  compiler: arm-linux-gnueabihf-gcc
                  env: TEST="arm-linux-gnueabihf" CROSS="--host=arm-linux-gnueabihf --prefix=/usr/arm-linux-gnueabihf"
                  install: true
                  script:
                          - mkdir cross
                          - pushd cross
                            # one can not include colon in the command or bad things will happen, so mimic it
                          - env echo -e 'Provides\x3a multiarch-support, debconf, debconf-2.0' > dummy
                          - equivs-build -a armhf dummy
                          - wget
                            http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.0.1f-1ubuntu2.22_armhf.deb
                            http://ports.ubuntu.com/pool/main/o/openssl/libssl1.0.0_1.0.1f-1ubuntu2.22_armhf.deb
                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-1ubuntu1_armhf.deb
                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-1ubuntu1_armhf.deb
                          - sudo dpkg-cross -i -M -A -a armhf *.deb
                          - popd
                          - ./bootstrap
                          - ./configure --prefix=$HOME/odp-install $CROSS
                            --disable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-test-perf-proc --enable-test-example
                          - make -j $(nproc)
                - stage: test
                  compiler: powerpc-linux-gnu-gcc
                  env: TEST="powerpc-linux-gnu" CROSS="--host=powerpc-linux-gnu --prefix=/usr/powerpc-linux-gnu"
                  install: true
                  script:
                          - mkdir cross
                          - pushd cross
                            # one can not include colon in the command or bad things will happen, so mimic it
                          - env echo -e 'Provides\x3a multiarch-support, debconf, debconf-2.0' > dummy
                          - equivs-build -a powerpc dummy
                          - wget
                            http://ports.ubuntu.com/pool/main/o/openssl/libssl-dev_1.0.1f-1ubuntu2.22_powerpc.deb
                            http://ports.ubuntu.com/pool/main/o/openssl/libssl1.0.0_1.0.1f-1ubuntu2.22_powerpc.deb
                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g-dev_1.2.8.dfsg-1ubuntu1_powerpc.deb
                            http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-1ubuntu1_powerpc.deb
                          - sudo dpkg-cross -i -M -A -a powerpc *.deb
                          - popd
                          - ./bootstrap
                          - ./configure --prefix=$HOME/odp-install $CROSS
                            --disable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-test-perf-proc --enable-test-example
                          - make -j $(nproc)
                - stage: test
                  env: TEST=coverage
                  compiler: gcc
                  script:
                          - ./bootstrap
                          - ./configure --prefix=$HOME/odp-install --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap CFLAGS="-O0 -coverage" CXXFLAGS="-O0 -coverage" LDFLAGS="--coverage"
                          - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" PATH=${PATH//:\.\/node_modules\/\.bin/} make check
                          - find . -type f -iname '*.[ch]' -not -path ".git/*" -execdir gcov {} \; ; bash <(curl -s https://codecov.io/bash) -X coveragepy
                - stage: test
                  env: TEST=distcheck
                  compiler: gcc
                  script:
                          - ./bootstrap
                          - ./configure --prefix=$HOME/odp-install --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example
                          - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make distcheck
                - stage: test
                  env: TEST=doxygen
                  compiler: gcc
                  script:
                          # doxygen does not trap on warnings, check for them here.
                          - ./bootstrap
                          - ./configure
                          - make doxygen-doc |tee doxygen.log
                          - fgrep -rvq warning ./doxygen.log
                - stage: test
                  env: TEST=checkpatch
                  compiler: gcc
                  script:
                          - echo ${TRAVIS_COMMIT_RANGE};
                          - ODP_PATCHES=`echo ${TRAVIS_COMMIT_RANGE} | sed 's/\.//'`;
                          - if [ -z "${ODP_PATCHES}" ]; then env; exit 1; fi;
                          - ./scripts/ci-checkpatches.sh ${ODP_PATCHES};

after_failure:
  - cat config.log
  - find . -name 'test-suite.log' -execdir grep -il "FAILED" {} \; -exec echo {} \; -exec cat {} \;