Revert "reassamble TODO"
[metze/wireshark/wip.git] / .travis.yml
1 language: minimal
2 dist: xenial
3 matrix:
4   include:
5     - name: OSX (clang-9) with PCAP
6       os: osx
7       compiler: clang
8       env: PCAP=ON
9     - name: OSX (clang-9) without PCAP
10       os: osx
11       compiler: clang
12       env: PCAP=OFF
13     - name: OSX (xcode10.1 clang-10) with PCAP
14       os: osx
15       osx_image: xcode10.1
16       env: PCAP=ON
17     - name: OSX (xcode10.1 clang-10) without PCAP
18       os: osx
19       osx_image: xcode10.1
20       env: PCAP=OFF
21     - name: Linux (gcc-8) with PCAP
22       os: linux
23       addons:
24         apt:
25           update: true
26           sources:
27             - ubuntu-toolchain-r-test
28           packages: g++-8
29       env:
30         - CXX=g++-8
31         - CC=gcc-8
32         - PCAP=ON
33     - name: Linux (gcc-8) without PCAP
34       os: linux
35       addons:
36         apt:
37           update: true
38           sources:
39             - ubuntu-toolchain-r-test
40           packages: g++-8
41       env:
42         - CXX=g++-8
43         - CC=gcc-8
44         - PCAP=OFF
45     - name: Linux (clang) with PCAP
46       os: linux
47       env:
48         - CXX=clang++
49         - CC=clang
50         - PCAP=ON
51     - name: Linux (clang) without PCAP
52       os: linux
53       env:
54         - CXX=clang++
55         - CC=clang
56         - PCAP=OFF
57     - name: Windows (VS2017 x64)
58       # Set a supported language, otherwise the Windows worker will not start.
59       language: shell
60       os: windows
61       env:
62         - PLATFORM: x64
63         - WIRESHARK_BASE_DIR: C:/wireshark-libs
64         - QT5_BASE_DIR: C:/Qt/5.12.0/msvc2017_64
65       cache:
66         directories:
67           - $WIRESHARK_BASE_DIR
68           - C:/Qt
69     - name: Windows (VS2017 Win32)
70       # Set a supported language, otherwise the Windows worker will not start.
71       language: shell
72       os: windows
73       env:
74         - PLATFORM: Win32
75         - WIRESHARK_BASE_DIR: C:/wireshark-libs
76         - QT5_BASE_DIR: C:/Qt/5.12.0/msvc2017
77       cache:
78         directories:
79           - $WIRESHARK_BASE_DIR
80           - C:/Qt
81 before_install:
82   - echo $TRAVIS_OS_NAME
83   # macos
84   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./tools/macos-setup-brew.sh; fi
85   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install softhsm; fi
86   # linux
87   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ./tools/debian-setup.sh --install-optional --install-test-deps -q; fi
88   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y python3-pip; fi
89   # windows
90   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cinst -y --no-progress python3 winflexbison strawberryperl; fi
91   - |
92     if [ "$TRAVIS_OS_NAME" == "windows" ]; then
93       # Ensure Python and the Scripts folder is available in PATH.
94       # refreshenv does not seem to work in bash, so reload it manually.
95       # Entries in the Machine PATH might contain trailing slashes, drop those.
96       # Apply Process paths before Machine to ensure /bin appears before others (otherwise casher will break and stall).
97       export PATH="$(powershell -Command '("Process", "Machine" | % {
98         [Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", ""
99       } | Select -Unique | % { cygpath $_ }) -Join ":"')"
100       echo "PATH=$PATH"
101       # Workaround broken casher implementation that extracts absolute paths to the current working directory
102       # See https://github.com/travis-ci/casher/pull/38
103       for path in wireshark-libs Qt; do if [ -d "$path" ]; then echo "Restoring C:/$path"; mv "$path/"* "C:/$path"; fi; done
104       # Update checksums to avoid invalidating the cache (saves 2-3mins).
105       if [ -d Qt ]; then md5deep64 -o f -r "C:/wireshark-libs" "C:/Qt" | sort > ~/.casher/md5sums_before; fi
106       # Workaround to avoid using perl from git-bash $PATH which lacks modules such as Pod::Usage
107       export CMAKE_PROGRAM_PATH=C:/Strawberry/perl/bin
108     fi
109   - |
110     if [ "$TRAVIS_OS_NAME" == "windows" ] && [ ! -e "$QT5_BASE_DIR/bin/moc.exe" ]; then
111       curl -vLo ~/qt-unified-windows-x86-online.exe http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe
112       if ! ~/qt-unified-windows-x86-online.exe --verbose --script tools/qt-installer-windows.qs > ~/qt-installer-output.txt; then
113         cat ~/qt-installer-output.txt; exit 1
114       fi
115       du -sm "$QT5_BASE_DIR"
116     fi
117   # all platforms
118   - pip3 install pytest pytest-xdist
119 before_script:
120   - mkdir build
121   - cd build
122   - if [ "$TRAVIS_OS_NAME" != "windows" ]; then cmake -GNinja -DENABLE_PCAP=${PCAP} ..; fi
123   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cmake -A $PLATFORM ..; fi
124 script:
125   # Enable parallelism for msbuild too (since CMake 3.12; ninja does not need it)
126   - export CMAKE_BUILD_PARALLEL_LEVEL=0
127   # Invoke ninja (Linux/macOS, --config is ignored) or msbuild (Windows)
128   - cmake --build . --config RelWithDebInfo
129   - cmake --build . --config RelWithDebInfo --target test-programs
130   - pytest -v
131 after_script:
132   - if [ -f run/tshark ]; then run/tshark --version; fi
133   - if [ -f run/RelWithDebInfo/tshark.exe ]; then run/RelWithDebInfo/tshark.exe --version; fi