forked from the-tcpdump-group/tcpdump
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
191 lines (178 loc) · 7.48 KB
/
.travis.yml
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
language: c
#
# Try building on these 4 architectures; all are 64-bit, and all but
# "s390x", a/k/a z/Architecture, are little-endian. The crypto library
# on Litle-endian PowerPC/Power ISA does some things that require more
# careful adherence to the documentation, so it's useful for testing
# that.
#
arch:
- amd64
- ppc64le
- s390x
- arm64
os:
- linux
- osx
dist: bionic
compiler:
- gcc
- clang
#
# Linux runs on all of the architectures listed above; macOS currently
# runs only on 64-bit x86, although the Spaceshipologists are all in a
# tizzy about the possibility of Arm-based Macs. Suppress the macOS
# builds that don't work.
#
# In addition, with newer versions of macOS, Apple ships a "gcc" that's
# just another front end to Clang, presumably for backwards
# compatibility with build scripts etc. that expect the compiler to be
# "gcc", so don't bother doing "gcc" builds on macOS.
#
# Furthermore, the Coverity-branch builds seem to time out on the
# non-x86 platforms, so suppress them as well. (Are they supported
# at all?)
#
# XXX - what is the fast_finish clause there for? According to
#
# https://docs.travis-ci.com/user/build-matrix/#fast-finishing
#
# "If some rows in the build matrix are allowed to fail, the build
# won't be marked as finished until they have completed.
#
# To mark the build as finished as soon as possible, add fast_finish:
# true to the jobs section of your .travis.yml like this:
#
# jobs:
# fast_finish: true
#
# Now, the build result will be determined as soon as all the required
# jobs finish, based on these results, while the rest of the
# allow_failures jobs continue to run."
#
# but we *have* no allow_failures jobs.
#
jobs:
fast_finish: true
exclude:
- arch: ppc64le
os: osx
- arch: s390x
os: osx
- arch: arm64
os: osx
- compiler: gcc
os: osx
- if: branch = coverity_scan
arch: ppc64le
- if: branch = coverity_scan
arch: s390x
- if: branch = coverity_scan
arch: arm64
cache: ccache
env:
global:
# encrypted COVERITY_SCAN_TOKEN from
# https://scan.coverity.com/projects/<project_id>/submit_build?tab=travis_ci
- secure: "DwUeukcRGl1vXNZDDt2237zCA58ZzmzWpCkPcb/Hpeh8OvRw1eBZJiu4L8iD2qtY4A/dPDvOeBiml5MF6bVri9Dui1yPkvkvFqIXzbK5CWS6Ye+NgSBNMwqnAjhTMv/x8I4Bvy9IhDGwj/2JXVUvjBddRMLRyr/ag+MDRB1IVAI="
# Coverity run condition (avoid matrix multiple runs), need customized
# build script. Need an update if new matrix cases.
- coverity_scan_run_condition='"$TRAVIS_CPU_ARCH" = amd64 -a "$TRAVIS_OS_NAME" = linux -a "$CC" = gcc -a "$REMOTE" = enable -a "$CMAKE" = no -a "$CRYPTO" = yes -a "$BUILD_LIBPCAP" = yes'
# Coverity script test mode (if true no uploading, avoid reaching the quota)
# usual processing: false.
- coverity_scan_script_test_mode=false
- MAKEFLAGS='-j 2' # Travis CI VMs come with 2 cores
matrix:
# NOTE: REMOTE= is for the libpcap build, which is done with autotools
# even if we're building tcpdump with CMake.
# It's irrelevant if we're building tcpdump with the system libpcap.
- BUILD_LIBPCAP=no CMAKE=no CRYPTO=no
- BUILD_LIBPCAP=no CMAKE=no CRYPTO=yes
- BUILD_LIBPCAP=no CMAKE=yes CRYPTO=no
- BUILD_LIBPCAP=no CMAKE=yes CRYPTO=yes
- BUILD_LIBPCAP=yes CMAKE=no REMOTE=disable CRYPTO=no
- BUILD_LIBPCAP=yes CMAKE=no REMOTE=disable CRYPTO=yes
- BUILD_LIBPCAP=yes CMAKE=no REMOTE=enable CRYPTO=no
- BUILD_LIBPCAP=yes CMAKE=no REMOTE=enable CRYPTO=yes
# The 'BUILD_LIBPCAP=yes CMAKE=yes' builds currently fail
# - BUILD_LIBPCAP=yes CMAKE=yes REMOTE=disable CRYPTO=no
# - BUILD_LIBPCAP=yes CMAKE=yes REMOTE=disable CRYPTO=yes
# - BUILD_LIBPCAP=yes CMAKE=yes REMOTE=enable CRYPTO=no
# - BUILD_LIBPCAP=yes CMAKE=yes REMOTE=enable CRYPTO=yes
addons:
coverity_scan:
# customized build script URL
# TRAVIS_REPO_SLUG: owner_name/repo_name of repository currently being built
# TRAVIS_BRANCH: name of the branch currently being built
build_script_url: https://raw.githubusercontent.com/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/.travis-coverity-scan-build.sh
# project metadata
project:
name: $TRAVIS_REPO_SLUG
# Where email notification of build analysis results will be sent
#notification_email: [email protected]
# Commands to prepare for build_command
build_command_prepend: ./configure
# This command will be added as an argument to "cov-build" to compile
# the project for analysis
build_command: make
# Pattern to match selecting branches that will run analysis
branch_pattern: coverity_scan
apt:
packages:
- libdbus-1-dev
- libbluetooth-dev
- libnl-genl-3-dev
- libibverbs-dev
- libssl-dev
- libssl1.0.0
- libsmi2-dev
- libcap-ng-dev
- libpcap-dev
git:
quiet: true
depth: 3
before_install:
- uname -a
- date
- gem install travis-conditions
- if [ "$TRAVIS_OS_NAME" = osx ]; then brew update >/dev/null; fi
- if [ "$TRAVIS_OS_NAME" = linux ]; then apt list --installed 'lib*-dev'; fi
install:
- if [ "$TRAVIS_OS_NAME" = osx ]; then brew install libsmi | grep -v '%'; fi
before_script:
- if [ "$BUILD_LIBPCAP" = yes ]; then (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth 3 --branch=master --quiet git://github.com/the-tcpdump-group/libpcap.git && cd libpcap && ./configure "--${REMOTE}-remote" --prefix=/tmp && make && make install); fi
script:
- if [ "$COVERITY_SCAN_BRANCH" = 1 ]; then exit 0; fi
- if [ "$TRAVIS_OS_NAME" = osx ]; then OSX_SSL_DIR=$(ls /usr/local/Cellar/openssl); echo "OSX_SSL_DIR=$OSX_SSL_DIR"; fi
- touch .devel configure
- if [ "$CMAKE" = no ]; then echo '$ ./configure [...]' && echo travis_fold:start:script.configure; fi
- if [ "$CMAKE" = no ]; then ./configure --with-crypto=${CRYPTO} CPPFLAGS="-I/usr/local/Cellar/openssl/$OSX_SSL_DIR/include/" --prefix=/tmp; fi
- if [ "$CMAKE" = no ]; then echo -n travis_fold:end:script.configure; fi
- if [ "$CMAKE" = yes ]; then mkdir build; fi
- if [ "$CMAKE" = yes ]; then cd build; fi
- if [ "$CMAKE" = yes ]; then echo travis_fold:start:script.cmake; fi
- if [ "$CMAKE" = yes ]; then cmake -DWITH_CRYPTO="$CRYPTO" -DCMAKE_PREFIX_PATH=/tmp -DCMAKE_INSTALL_PREFIX=/tmp ..; fi
- if [ "$CMAKE" = yes ]; then echo -n travis_fold:end:script.cmake; fi
- make -s CFLAGS=-Werror
- echo '$ make install [...]' && echo travis_fold:start:script.make_install
- PATH=$PATH make install
- echo -n travis_fold:end:script.make_install
- if [ "$BUILD_LIBPCAP" = yes ]; then make check; fi
- ./tcpdump --version
- ./tcpdump -h
- ./tcpdump -D
- sudo ./tcpdump -J
- sudo ./tcpdump -L
- if [ "$TRAVIS_OS_NAME" = linux -a "$TRAVIS_CPU_ARCH" != ppc64le -a "$TRAVIS_CPU_ARCH" != s390x ]; then sudo ./tcpdump -#n -c 10; fi
- if [ "$CMAKE" = no ]; then make releasetar; fi
- echo '$ cat Makefile [...]'; echo travis_fold:start:script.cat_makefile
- if [ "$CMAKE" = no ]; then cat Makefile | sed -n '1,/DO NOT DELETE THIS LINE -- mkdep uses it/p'; fi
- if [ "$CMAKE" = yes ]; then cat Makefile; fi
- echo -n travis_fold:end:script.cat_makefile
- echo '$ cat config.h'; echo travis_fold:start:script.cat_config_h
- cat config.h
- echo -n travis_fold:end:script.cat_config_h
- if [ "$CMAKE" = no ]; then echo '$ cat config.log'; echo travis_fold:start:script.cat_config_log; fi
- if [ "$CMAKE" = no ]; then cat config.log; fi
- if [ "$CMAKE" = no ]; then echo -n travis_fold:end:script.cat_config_log; fi
- if [ "$TRAVIS_OS_NAME" = osx ]; then sleep 10; fi