NSIS: Make the licensing page match reality.
[gd/wireshark/.git] / .gitlab-ci.yml
1 .build: &build
2   stage: build
3   after_script:
4     - for builddir in build/packaging/rpm/BUILD/wireshark-*/build build/packaging/rpm/BUILD/wireshark-* build; do [ ! -d "$builddir" ] || break; done
5     - if [ "$CI_JOB_NAME" = "build:rpm-opensuse-42.3" ]; then export LD_LIBRARY_PATH=$builddir/run; fi
6     - if [ -f $builddir/run/tshark ]; then $builddir/run/tshark --version; fi
7
8 # The custom Ubuntu image pre-installs dependencies and compilers to speed up the build:
9 # https://hub.docker.com/r/wireshark/wireshark-ubuntu-dev
10 # https://github.com/wireshark/wireshark-ubuntu-dev-docker
11 .build-ubuntu: &build-ubuntu
12   <<: *build
13   image: wireshark/wireshark-ubuntu-dev
14   retry: 1
15   before_script:
16     - apt-get update -qq
17     - ./tools/debian-setup.sh --install-optional --install-test-deps -y
18     - useradd user
19     - locale-gen en_US.UTF-8
20     - export LANG=en_US.UTF-8
21     - export PYTEST_ADDOPTS=--skip-missing-programs=dumpcap,rawshark
22     - mkdir build
23     - cd build
24   script:
25     - cmake -GNinja $CMAKE_ARGS ..
26     - ninja
27     - ninja test-programs
28     - chown -R user .
29     - if [ -f run/dumpcap ]; then setcap cap_net_raw,cap_net_admin+eip run/dumpcap; fi
30     - su user -c pytest-3
31
32 .build-rpm: &build-rpm
33   <<: *build
34   artifacts:
35     paths:
36       - build/packaging/rpm/RPMS
37     expire_in: 3 days
38
39 gcc-5:
40   <<: *build-ubuntu
41   variables:
42     CC: gcc-5
43     CXX: g++-5
44 gcc-6:
45   <<: *build-ubuntu
46   variables:
47     CC: gcc-6
48     CXX: g++-6
49 gcc-7:
50   <<: *build-ubuntu
51   variables:
52     CC: gcc-7
53     CXX: g++-7
54 gcc-8:
55   <<: *build-ubuntu
56   variables:
57     CC: gcc-8
58     CXX: g++-8
59 gcc-8-nopcap:
60   <<: *build-ubuntu
61   variables:
62     CMAKE_ARGS: -DENABLE_PCAP=NO
63     CC: gcc-8
64     CXX: g++-8
65 clang-5:
66   <<: *build-ubuntu
67   variables:
68     CMAKE_ARGS: -DCMAKE_C_FLAGS=-Wframe-larger-than=20000
69     CC: clang-5.0
70     CXX: clang++-5.0
71 clang-6:
72   <<: *build-ubuntu
73   variables:
74     CMAKE_ARGS: -DCMAKE_C_FLAGS=-Wframe-larger-than=20000
75     CC: clang-6.0
76     CXX: clang++-6.0
77 clang-7:
78   <<: *build-ubuntu
79   variables:
80     CMAKE_ARGS: -DCMAKE_C_FLAGS=-Wframe-larger-than=20000
81     CC: clang-7
82     CXX: clang++-7
83 clang-7-nopcap:
84   <<: *build-ubuntu
85   variables:
86     CMAKE_ARGS: -DENABLE_PCAP=NO -DCMAKE_C_FLAGS=-Wframe-larger-than=20000
87     CC: clang-7
88     CXX: clang++-7
89 build:rpm-centos-7:
90   <<: *build-rpm
91   image: centos:7
92   script:
93     - yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
94     - tools/rpm-setup.sh --install-optional -y
95     - mkdir build
96     - cd build
97     - cmake3 -GNinja ..
98     - ninja-build rpm-package
99 test:rpm-centos-7:
100   stage: test
101   image: centos:7
102   script:
103     - yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
104     - yum --nogpgcheck localinstall -y build/packaging/rpm/RPMS/x86_64/*.rpm
105     - tshark --version
106   dependencies:
107     - build:rpm-centos-7
108   variables:
109     GIT_STRATEGY: none
110 .build-rpm-opensuse: &build-rpm-opensuse
111   <<: *build-rpm
112   script:
113     - zypper --non-interactive install update-desktop-files
114     - tools/rpm-setup.sh --install-optional ruby
115     - gem install asciidoctor -v 1.5.8 --no-ri --no-rdoc
116     - mkdir build
117     - cd build
118     - cmake -GNinja ..
119     - ninja rpm-package
120 .test-rpm-opensuse: &test-rpm-opensuse
121   stage: test
122   script:
123     - zypper --no-gpg-checks install -y build/packaging/rpm/RPMS/x86_64/*.rpm
124     - tshark --version
125   variables:
126     GIT_STRATEGY: none
127 build:rpm-opensuse-42.3:
128   <<: *build-rpm-opensuse
129   image: opensuse/leap:42.3
130 test:rpm-opensuse-42.3:
131   <<: *test-rpm-opensuse
132   image: opensuse/leap:42.3
133   dependencies:
134     - build:rpm-opensuse-42.3
135 build:rpm-opensuse-15.1:
136   <<: *build-rpm-opensuse
137   image: opensuse/leap:15.1
138 test:rpm-opensuse-15.1:
139   <<: *test-rpm-opensuse
140   image: opensuse/leap:15.1
141   dependencies:
142     - build:rpm-opensuse-15.1
143 .build-rpm-fedora: &build-rpm-fedora
144   <<: *build-rpm
145   script:
146     - dnf upgrade -y
147     - tools/rpm-setup.sh --install-optional -y
148     - mkdir build
149     - cd build
150     - cmake3 -GNinja ..
151     - ninja-build rpm-package
152 .test-rpm-fedora: &test-rpm-fedora
153   stage: test
154   script:
155     - dnf install -y build/packaging/rpm/RPMS/x86_64/*.rpm
156     - tshark --version
157   variables:
158     GIT_STRATEGY: none
159 build:rpm-fedora-28:
160   <<: *build-rpm-fedora
161   image: fedora:28
162 test:rpm-fedora-28:
163   <<: *test-rpm-fedora
164   image: fedora:28
165   dependencies:
166     - build:rpm-fedora-28
167 build:rpm-fedora-29:
168   <<: *build-rpm-fedora
169   image: fedora:29
170 test:rpm-fedora-29:
171   <<: *test-rpm-fedora
172   image: fedora:29
173   dependencies:
174     - build:rpm-fedora-29
175
176 # Job to generate packages for Debian stable
177 build:debian-stable:
178   image: debian:stable
179   stage: build
180   before_script:
181     - ./tools/debian-setup.sh --install-optional --install-test-deps -y --install-deb-deps
182   script:
183     # Shared GitLab runners limit the log size to 4M, so reduce verbosity. See
184     # https://gitlab.com/gitlab-com/support-forum/issues/2790
185     - DH_QUIET=1 dpkg-buildpackage -b --no-sign -jauto
186     - mkdir debian-packages
187     - mv ../*.deb debian-packages/
188   artifacts:
189     paths:
190       - debian-packages/*.deb
191     expire_in: 3 days