Note the Microsoft standard, fix the LZNT1 comment.
[gd/wireshark/.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.3/msvc2017_64
65       cache:
66         directories:
67           - travis-cache
68     - name: Windows (VS2017 Win32)
69       # Set a supported language, otherwise the Windows worker will not start.
70       language: shell
71       os: windows
72       env:
73         - PLATFORM: Win32
74         - WIRESHARK_BASE_DIR: C:/wireshark-libs
75         - QT5_BASE_DIR: C:/Qt/5.12.3/msvc2017
76       cache:
77         directories:
78           - travis-cache
79   # Windows builds are experimental in Travis and are unreliable, do not force it.
80   allow_failures:
81     - os: windows
82 before_install:
83   - echo $TRAVIS_OS_NAME
84   # macos
85   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./tools/macos-setup-brew.sh; fi
86   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install softhsm; fi
87   - if [ "$TRAVIS_OS_NAME" == "osx" ]; then sed s/access_bpf/staff/ packaging/macosx/ChmodBPF/ChmodBPF | sudo bash; fi
88   # linux
89   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ./tools/debian-setup.sh --install-optional --install-test-deps -q; fi
90   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y python3-pip; fi
91   # windows
92   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-cache-windows.sh restore; fi
93   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cinst -y --no-progress python3 winflexbison strawberryperl; fi
94   - |
95     if [ "$TRAVIS_OS_NAME" == "windows" ]; then
96       # Ensure Python and the Scripts folder is available in PATH.
97       # refreshenv does not seem to work in bash, so reload it manually.
98       # Entries in the Machine PATH might contain trailing slashes, drop those.
99       # Apply Process paths before Machine to ensure /bin appears before others (otherwise casher will break and stall).
100       export PATH="$(powershell -Command '("Process", "Machine" | % {
101         [Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", ""
102       } | Select -Unique | % { cygpath $_ }) -Join ":"')"
103       echo "PATH=$PATH"
104       # Workaround to avoid using perl from git-bash $PATH which lacks modules such as Pod::Usage
105       export CMAKE_PROGRAM_PATH=C:/Strawberry/perl/bin
106     fi
107   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-install-qt-windows.sh; fi
108   # all platforms
109   - pip3 install pytest pytest-xdist
110 before_script:
111   - mkdir build
112   - cd build
113   - if [ "$TRAVIS_OS_NAME" != "windows" ]; then cmake -GNinja -DENABLE_PCAP=${PCAP} ..; fi
114   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cmake -A $PLATFORM ..; fi
115 script:
116   # Enable parallelism for msbuild too (since CMake 3.12; ninja does not need it)
117   - export CMAKE_BUILD_PARALLEL_LEVEL=0
118   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then cmake() { ../tools/filter-msbuild.py cmake "$@"; }; fi
119   # Invoke ninja (Linux/macOS, --config is ignored) or msbuild (Windows)
120   - cmake --build . --config RelWithDebInfo
121   - cmake --build . --config RelWithDebInfo --target test-programs
122   - if [ "$PCAP" = "OFF" ]; then export PYTEST_ADDOPTS=--skip-missing-programs=dumpcap,rawshark; fi
123   - if [ "$TRAVIS_OS_NAME" == "linux" -a "$PCAP" = "ON" ]; then sudo setcap cap_net_raw,cap_net_admin+eip run/dumpcap; fi
124   - pytest
125   - cd ..
126 before_cache:
127   - if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-cache-windows.sh save; fi
128 after_script:
129   - cd build
130   - if [ -f run/tshark ]; then run/tshark --version; fi
131   - if [ -f run/RelWithDebInfo/tshark.exe ]; then run/RelWithDebInfo/tshark.exe --version; fi
132   - ../test/travis-upload-artifacts.sh