]> git.ipfire.org Git - people/ms/suricata.git/blame - .github/workflows/builds.yml
doc/userguide: update http keywords
[people/ms/suricata.git] / .github / workflows / builds.yml
CommitLineData
3887f8d1
JI
1name: builds
2
3on:
4 - push
5 - pull_request
6
ced66563
JI
7env:
8 DEFAULT_LIBHTP_REPO: https://github.com/OISF/libhtp
9 DEFAULT_LIBHTP_BRANCH: 0.5.x
7d22993a
JI
10 DEFAULT_LIBHTP_PR:
11
ced66563
JI
12 DEFAULT_SU_REPO: https://github.com/OISF/suricata-update
13 DEFAULT_SU_BRANCH: master
7d22993a
JI
14 DEFAULT_SU_PR:
15
ced66563
JI
16 DEFAULT_SV_REPO: https://github.com/OISF/suricata-verify
17 DEFAULT_SV_BRANCH: master
7d22993a 18 DEFAULT_SV_PR:
ced66563 19
1ec6307d
JI
20 DEFAULT_CFLAGS: "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-function"
21
dfbd38e8
JI
22 # Apt sometimes likes to ask for user input, this will prevent that.
23 DEBIAN_FRONTEND: "noninteractive"
24
cb963f86
JI
25 # A known good Rust version we should test against.
26 RUST_VERSION_KNOWN: "1.37.0"
27
3887f8d1
JI
28jobs:
29
ced66563
JI
30 prep:
31 name: Prepare Build
32 runs-on: ubuntu-latest
33 steps:
34 - run: sudo apt update && sudo apt -y install jq curl
35 - name: Parse repo and branch information
36 env:
37 # We fetch the actual pull request to get the latest body as
38 # github.event.pull_request.body has the body from the
39 # initial pull request.
40 PR_HREF: ${{ github.event.pull_request._links.self.href }}
41 run: |
42 if test "${PR_HREF}"; then
d2c8c9f5
JL
43 body=$(curl -s "${PR_HREF}" | jq -r .body | tr -d '\r')
44
ced66563
JI
45 libhtp_repo=$(echo "${body}" | awk '/^libhtp-repo/ { print $2 }')
46 libhtp_branch=$(echo "${body}" | awk '/^libhtp-branch/ { print $2 }')
7d22993a
JI
47 libhtp_pr=$(echo "${body}" | awk '/^libhtp-pr/ { print $2 }')
48
ced66563
JI
49 su_repo=$(echo "${body}" | awk '/^suricata-update-repo/ { print $2 }')
50 su_branch=$(echo "${body}" | awk '/^suricata-update-branch/ { print $2 }')
7d22993a
JI
51 su_pr=$(echo "${body}" | awk '/^suricata-update-pr/ { print $2 }')
52
ced66563
JI
53 sv_repo=$(echo "${body}" | awk '/^suricata-verify-repo/ { print $2 }')
54 sv_branch=$(echo "${body}" | awk '/^suricata-verify-branch/ { print $2 }')
7d22993a 55 sv_pr=$(echo "${body}" | awk '/^suricata-verify-pr/ { print $2 }')
ced66563 56 fi
2ede7361
JI
57 echo "libhtp_repo=${libhtp_repo:-${DEFAULT_LIBHTP_REPO}}" >> $GITHUB_ENV
58 echo "libhtp_branch=${libhtp_branch:-${DEFAULT_LIBHTP_BRANCH}}" >> $GITHUB_ENV
59 echo "libhtp_pr=${libhtp_pr:-${DEFAULT_LIBHTP_PR}}" >> $GITHUB_ENV
7d22993a 60
2ede7361
JI
61 echo "su_repo=${su_repo:-${DEFAULT_SU_REPO}}" >> $GITHUB_ENV
62 echo "su_branch=${su_branch:-${DEFAULT_SU_BRANCH}}" >> $GITHUB_ENV
63 echo "su_pr=${su_pr:-${DEFAULT_SU_PR}}" >> $GITHUB_ENV
7d22993a 64
2ede7361
JI
65 echo "sv_repo=${sv_repo:-${DEFAULT_SV_REPO}}" >> $GITHUB_ENV
66 echo "sv_branch=${sv_branch:-${DEFAULT_SV_BRANCH}}" >> $GITHUB_ENV
67 echo "sv_pr=${sv_pr:-${DEFAULT_SV_PR}}" >> $GITHUB_ENV
ced66563
JI
68 - name: Fetching libhtp
69 run: |
7d22993a
JI
70 git clone --depth 1 ${libhtp_repo} -b ${libhtp_branch} libhtp
71 if [[ "${libhtp_pr}" != "" ]]; then
72 cd libhtp
3a3a9e13 73 git fetch origin pull/${libhtp_pr}/head:prep
7d22993a
JI
74 git checkout prep
75 cd ..
76 fi
ced66563 77 tar zcf libhtp.tar.gz libhtp
ced66563
JI
78 - name: Fetching suricata-update
79 run: |
7d22993a
JI
80 git clone --depth 1 ${su_repo} -b ${su_branch} suricata-update
81 if [[ "${su_pr}" != "" ]]; then
82 cd suricata-update
83 git fetch origin pull/${su_pr}/head:prep
84 git checkout prep
85 cd ..
86 fi
ced66563 87 tar zcf suricata-update.tar.gz suricata-update
ced66563
JI
88 - name: Fetching suricata-verify
89 run: |
7d22993a
JI
90 git clone --depth 1 ${sv_repo} -b ${sv_branch} suricata-verify
91 if [[ "${sv_pr}" != "" ]]; then
92 cd suricata-verify
93 git fetch origin pull/${sv_pr}/head:prep
94 git checkout prep
95 cd ..
96 fi
ced66563 97 tar zcf suricata-verify.tar.gz suricata-verify
ced66563
JI
98 - uses: actions/upload-artifact@v2
99 name: Uploading prep archive
100 with:
101 name: prep
102 path: .
103
3887f8d1
JI
104 centos-8:
105 name: CentOS 8
106 runs-on: ubuntu-latest
107 container: centos:8
ced66563 108 needs: prep
3887f8d1 109 steps:
3887f8d1
JI
110 # Cache Rust stuff.
111 - name: Cache cargo registry
112 uses: actions/cache@v1
113 with:
114 path: ~/.cargo/registry
115 key: cargo-registry
116
ced66563
JI
117 - uses: actions/checkout@v2
118
119 # Download and extract dependency archives created during prep
120 # job.
121 - uses: actions/download-artifact@v2
122 with:
123 name: prep
124 path: prep
125 - run: tar xvf prep/libhtp.tar.gz
126 - run: tar xvf prep/suricata-update.tar.gz
127 - run: tar xvf prep/suricata-verify.tar.gz
128
3887f8d1
JI
129 - name: Install system packages
130 run: |
131 yum -y install dnf-plugins-core
132 yum config-manager --set-enabled PowerTools
133 yum -y install \
134 autoconf \
135 automake \
136 cargo-vendor \
137 diffutils \
138 file-devel \
139 gcc \
140 gcc-c++ \
141 git \
142 jansson-devel \
143 jq \
144 lua-devel \
145 libtool \
146 libyaml-devel \
147 libnfnetlink-devel \
148 libnetfilter_queue-devel \
149 libnet-devel \
150 libcap-ng-devel \
151 libevent-devel \
152 libmaxminddb-devel \
153 libpcap-devel \
154 libtool \
155 lz4-devel \
156 make \
157 nss-devel \
158 pcre-devel \
159 pkgconfig \
160 python3-devel \
161 python3-sphinx \
162 python3-yaml \
163 rust-toolset \
164 sudo \
165 which \
166 zlib-devel
167 # These packages required to build the PDF.
168 yum -y install \
169 texlive-latex \
170 texlive-cmap \
171 texlive-collection-latexrecommended \
172 texlive-fncychap \
173 texlive-titlesec \
174 texlive-tabulary \
175 texlive-framed \
176 texlive-wrapfig \
177 texlive-upquote \
178 texlive-capt-of \
179 texlive-needspace \
b573c16d 180 - name: Install cbindgen
4318c1de 181 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 182 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3887f8d1
JI
183 - name: Configuring
184 run: |
185 ./autogen.sh
8b38db4a 186 CFLAGS="${DEFAULT_CFLAGS}" ./configure
211b193e
JI
187 - run: make -j2 distcheck
188 env:
189 DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks"
190 - run: test -e doc/userguide/suricata.1
5d0d6302
JI
191 - name: Building Rust documentation
192 run: make doc
193 working-directory: rust
211b193e 194 - name: Preparing distribution
3887f8d1 195 run: |
3887f8d1
JI
196 mkdir dist
197 mv suricata-*.tar.gz dist
198 - uses: actions/upload-artifact@v1
199 name: Uploading distribution
200 with:
201 name: dist
202 path: dist
203
204 centos-7:
205 name: CentOS 7
206 runs-on: ubuntu-latest
207 container: centos:7
208 needs: centos-8
209 steps:
210 - name: Install system dependencies
211 run: |
212 yum -y install epel-release
213 yum -y install \
0de0c60c
JI
214 autoconf \
215 automake \
3887f8d1
JI
216 cargo \
217 diffutils \
218 file-devel \
219 gcc \
220 gcc-c++ \
221 jansson-devel \
222 jq \
223 lua-devel \
224 libtool \
225 libyaml-devel \
226 libnfnetlink-devel \
227 libnetfilter_queue-devel \
228 libnet-devel \
229 libcap-ng-devel \
230 libevent-devel \
231 libmaxminddb-devel \
232 libpcap-devel \
233 lz4-devel \
234 make \
235 nss-devel \
236 pcre-devel \
237 pkgconfig \
238 rust \
239 sudo \
240 which \
241 zlib-devel
242 - name: Download suricata.tar.gz
ced66563 243 uses: actions/download-artifact@v2
3887f8d1
JI
244 with:
245 name: dist
ced66563 246 - run: tar zxvf suricata-*.tar.gz --strip-components=1
0de0c60c
JI
247 # This isn't really needed as we are building from a prepared
248 # package, but some package managers like RPM and Debian like to
249 # run this command even on prepared packages, so make sure it
250 # works.
251 - name: Test autoreconf
252 run: autoreconf -fv --install
8b38db4a 253 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
83630015
JI
254 - run: make -j2
255 - run: make install
256 - run: make install-conf
257 - run: make distcheck
0a1d2fce
JI
258 - run: make clean
259 - run: make -j2
3887f8d1
JI
260
261 centos-6:
262 name: CentOS 6
263 runs-on: ubuntu-latest
264 container: centos:6
265 needs: centos-8
266 steps:
267 - name: Install Rust
95e7246b 268 run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.34.2 -y
2ede7361 269 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3887f8d1
JI
270 - name: Install system dependencies
271 run: |
272 yum -y install epel-release
273 yum -y install \
274 file-devel \
275 gcc \
276 gcc-c++ \
277 jq \
278 jansson-devel \
279 make \
280 libyaml-devel \
281 libpcap-devel \
282 pcre-devel \
283 python34-PyYAML \
284 nss-devel \
285 sudo \
286 which \
287 zlib-devel
288 - name: Download suricata.tar.gz
ced66563
JI
289 # Can't use @v2 here as it uses a binary that requires a newer
290 # glibc than provided by CentOS 6.
3887f8d1
JI
291 uses: actions/download-artifact@v1
292 with:
293 name: dist
ced66563 294 - run: tar xvf dist/suricata-*.tar.gz --strip-components=1
8b38db4a 295 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
ced66563
JI
296 - run: make -j2
297 - run: make install
298 - run: make install-conf
5d0d6302
JI
299 - name: Building Rust documentation
300 run: make doc
301 working-directory: rust
3887f8d1 302
1ec6307d 303 fedora-32:
b698f66c 304 name: Fedora 32 (debug, clang, asan, wshadow, rust-strict)
1ec6307d
JI
305 runs-on: ubuntu-latest
306 container: fedora:32
307 needs: prep
308 steps:
309
310 # Cache Rust stuff.
311 - name: Cache cargo registry
312 uses: actions/cache@v1
313 with:
314 path: ~/.cargo/registry
315 key: cargo-registry
316
317 - run: |
318 dnf -y install \
319 autoconf \
320 automake \
321 cargo \
322 ccache \
323 clang \
324 diffutils \
325 file-devel \
326 gcc \
327 gcc-c++ \
328 git \
329 jansson-devel \
330 jq \
331 lua-devel \
332 libasan \
333 libtool \
334 libyaml-devel \
335 libnfnetlink-devel \
336 libnetfilter_queue-devel \
337 libnet-devel \
338 libcap-ng-devel \
339 libevent-devel \
340 libmaxminddb-devel \
341 libpcap-devel \
342 libtool \
343 lz4-devel \
344 make \
345 nspr-devel \
346 nss-devel \
347 nss-softokn-devel \
348 pcre-devel \
349 pkgconfig \
350 python3-yaml \
351 sudo \
352 which \
353 zlib-devel
354 - run: |
355 cargo install --debug cbindgen
2ede7361 356 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
1ec6307d
JI
357 - uses: actions/checkout@v2
358 - uses: actions/download-artifact@v2
359 with:
360 name: prep
361 path: prep
362 - run: tar xf prep/libhtp.tar.gz
363 - run: ./autogen.sh
b698f66c 364 - run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict
1ec6307d
JI
365 env:
366 ac_cv_func_realloc_0_nonnull: "yes"
367 ac_cv_func_malloc_0_nonnull: "yes"
368 - run: make -j2
369 - run: ASAN_OPTIONS="detect_leaks=0" ./src/suricata -u -l .
370 - name: Extracting suricata-verify
371 run: tar xf prep/suricata-verify.tar.gz
372 - name: Running suricata-verify
373 run: python3 ./suricata-verify/run.py
374
280ab657
JI
375 fedora-32-no-jansson:
376 name: Fedora 32 (no jansson)
377 runs-on: ubuntu-latest
378 container: fedora:32
379 needs: prep
380 steps:
381
382 # Cache Rust stuff.
383 - name: Cache cargo registry
384 uses: actions/cache@v1
385 with:
386 path: ~/.cargo/registry
387 key: cargo-registry
388
389 - run: |
390 dnf -y install \
391 autoconf \
392 automake \
393 cargo \
394 ccache \
395 clang \
396 diffutils \
397 file-devel \
398 gcc \
399 gcc-c++ \
400 git \
401 lua-devel \
402 libasan \
403 libtool \
404 libyaml-devel \
405 libnfnetlink-devel \
406 libnetfilter_queue-devel \
407 libnet-devel \
408 libcap-ng-devel \
409 libevent-devel \
410 libmaxminddb-devel \
411 libpcap-devel \
412 libtool \
413 lz4-devel \
414 make \
415 nspr-devel \
416 nss-devel \
417 nss-softokn-devel \
418 pcre-devel \
419 pkgconfig \
420 python3-yaml \
421 sudo \
422 which \
423 zlib-devel
424 - run: |
425 cargo install --debug cbindgen
2ede7361 426 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
280ab657
JI
427 - uses: actions/checkout@v2
428 - uses: actions/download-artifact@v2
429 with:
430 name: prep
431 path: prep
432 - run: tar xf prep/libhtp.tar.gz
433 - run: ./autogen.sh
434 - run: |
435 if ./configure; then
436 echo "error: configure should have failed"
437 exit 1
438 else
439 exit 0
440 fi
441
3887f8d1
JI
442 fedora-31:
443 name: Fedora 31
444 runs-on: ubuntu-latest
445 container: fedora:31
ced66563 446 needs: prep
3887f8d1
JI
447 steps:
448
449 # Cache Rust stuff.
450 - name: Cache cargo registry
451 uses: actions/cache@v1
452 with:
453 path: ~/.cargo/registry
454 key: cargo-registry
455
456 - run: |
457 dnf -y install \
458 autoconf \
459 automake \
460 cargo \
461 ccache \
462 diffutils \
463 file-devel \
464 gcc \
465 gcc-c++ \
466 git \
467 jansson-devel \
468 jq \
469 lua-devel \
470 libtool \
471 libyaml-devel \
472 libnfnetlink-devel \
473 libnetfilter_queue-devel \
474 libnet-devel \
475 libcap-ng-devel \
476 libevent-devel \
477 libmaxminddb-devel \
478 libpcap-devel \
479 libtool \
480 lz4-devel \
481 make \
482 nspr-devel \
483 nss-devel \
484 nss-softokn-devel \
485 pcre-devel \
486 pkgconfig \
487 python3-yaml \
488 sudo \
489 which \
490 zlib-devel
7c0c2e76
JI
491 - name: Installing packages to build documentation
492 run: |
493 dnf -y install \
494 python3-sphinx \
495 texlive-scheme-full
b573c16d 496 - name: Install cbindgen
4318c1de 497 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 498 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
ced66563
JI
499 - uses: actions/checkout@v2
500 - uses: actions/download-artifact@v2
501 with:
502 name: prep
503 path: prep
504 - run: tar xf prep/libhtp.tar.gz
3887f8d1 505 - run: ./autogen.sh
8b38db4a 506 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests
3887f8d1
JI
507 - run: make -j2
508 - run: make check
7c0c2e76
JI
509 - run: make dist
510 - run: test -e doc/devguide/devguide.pdf
511 - run: test -e doc/userguide/userguide.pdf
2ff963db 512 - run: make distcheck
ced66563
JI
513 - name: Extracting suricata-verify
514 run: tar xf prep/suricata-verify.tar.gz
3887f8d1
JI
515 - name: Running suricata-verify
516 run: python3 ./suricata-verify/run.py
517
dfbd38e8
JI
518 ubuntu-20-04:
519 name: Ubuntu 20.04 (no nss, no nspr)
520 runs-on: ubuntu-latest
521 container: ubuntu:20.04
522 needs: prep
523 steps:
524 - name: Install dependencies
525 run: |
526 apt update
527 apt -y install \
528 libpcre3 \
529 libpcre3-dev \
530 build-essential \
531 autoconf \
532 automake \
533 git \
534 jq \
535 libtool \
536 libpcap-dev \
537 libnet1-dev \
538 libyaml-0-2 \
539 libyaml-dev \
540 libcap-ng-dev \
541 libcap-ng0 \
542 libmagic-dev \
543 libnetfilter-queue-dev \
544 libnetfilter-queue1 \
545 libnfnetlink-dev \
546 libnfnetlink0 \
547 libhiredis-dev \
548 libjansson-dev \
549 libevent-dev \
550 libevent-pthreads-2.1-7 \
551 libjansson-dev \
552 libpython2.7 \
553 make \
554 parallel \
555 python3-yaml \
556 rustc \
557 software-properties-common \
558 zlib1g \
559 zlib1g-dev \
560 exuberant-ctags
561 - name: Install cbindgen
562 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 563 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
dfbd38e8
JI
564 - uses: actions/checkout@v2
565 - uses: actions/download-artifact@v2
566 with:
567 name: prep
568 path: prep
569 - run: tar xf prep/libhtp.tar.gz
570 - run: ./autogen.sh
8b38db4a 571 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --disable-nss --disable-nspr
dfbd38e8
JI
572 - run: make -j2
573 - run: make dist
574 - name: Extracting suricata-verify
575 run: tar xf prep/suricata-verify.tar.gz
576 - name: Running suricata-verify
577 run: python3 ./suricata-verify/run.py
578
975b58c0
JI
579 ubuntu-20-04-ndebug:
580 name: Ubuntu 20.04 (-DNDEBUG)
581 runs-on: ubuntu-latest
582 container: ubuntu:20.04
583 needs: prep
584 steps:
585
586 - name: Install dependencies
587 run: |
588 apt update
589 apt -y install \
590 build-essential \
591 autoconf \
592 automake \
593 git \
594 jq \
595 libtool \
596 libpcap-dev \
597 libnet1-dev \
598 libyaml-0-2 \
599 libyaml-dev \
600 libcap-ng-dev \
601 libcap-ng0 \
602 libmagic-dev \
603 libnetfilter-queue-dev \
604 libnetfilter-queue1 \
605 libnfnetlink-dev \
606 libnfnetlink0 \
607 libhiredis-dev \
608 libjansson-dev \
609 libevent-dev \
610 libevent-pthreads-2.1-7 \
611 libjansson-dev \
612 libpython2.7 \
613 libpcre3 \
614 libpcre3-dev \
615 make \
616 parallel \
617 python3-yaml \
618 rustc \
619 software-properties-common \
620 zlib1g \
621 zlib1g-dev \
622 exuberant-ctags
623 - name: Install cbindgen
624 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 625 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
975b58c0
JI
626 - uses: actions/checkout@v2
627 - uses: actions/download-artifact@v2
628 with:
629 name: prep
630 path: prep
631 - run: tar xf prep/libhtp.tar.gz
632 - run: ./autogen.sh
633 - run: CFLAGS="$DEFAULT_CFLAGS -DNDEBUG" ./configure --enable-unittests
634 - run: make -j2
635 - run: make check
636 - run: make dist
637 - name: Extracting suricata-verify
638 run: tar xf prep/suricata-verify.tar.gz
639 - name: Running suricata-verify
640 run: python3 ./suricata-verify/run.py
641
146a1ee1
JI
642 ubuntu-20-04-too-old-rust:
643 name: Ubuntu 20.04 (unsupported rust)
644 runs-on: ubuntu-latest
645 container: ubuntu:20.04
646 needs: centos-8
647 steps:
648 - name: Install dependencies
649 run: |
650 apt update
651 apt -y install \
652 build-essential \
653 curl \
654 libtool \
655 libpcap-dev \
656 libnet1-dev \
657 libyaml-0-2 \
658 libyaml-dev \
659 libcap-ng-dev \
660 libcap-ng0 \
661 libmagic-dev \
662 libnetfilter-queue-dev \
663 libnetfilter-queue1 \
664 libnfnetlink-dev \
665 libnfnetlink0 \
666 libhiredis-dev \
667 libjansson-dev \
668 libevent-dev \
669 libevent-pthreads-2.1-7 \
670 libjansson-dev \
671 libpython2.7 \
672 libpcre3 \
673 libpcre3-dev \
674 make \
675 python3-yaml \
676 software-properties-common \
677 zlib1g \
678 zlib1g-dev \
679 - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.33.0 -y
2ede7361 680 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
146a1ee1
JI
681 - name: Download suricata.tar.gz
682 uses: actions/download-artifact@v2
683 with:
684 name: dist
685 - run: tar zxvf suricata-*.tar.gz --strip-components=1
686 - run: |
687 if ./configure; then
688 echo "error: configure should have failed"
689 exit 1
690 else
691 exit 0
692 fi
693
0ae63e85
SB
694 ubuntu-18-04-debug-validation:
695 name: Ubuntu 18.04 (Debug Validation)
696 runs-on: ubuntu-18.04
697 container: ubuntu:18.04
698 needs: prep
699 steps:
700
701 # Cache Rust stuff.
702 - name: Cache cargo registry
703 uses: actions/cache@v1
704 with:
705 path: ~/.cargo/registry
706 key: cargo-registry
707
708 - name: Install dependencies
709 run: |
710 apt update
711 apt -y install \
712 libpcre3 \
713 libpcre3-dev \
714 build-essential \
715 autoconf \
716 automake \
717 git \
718 jq \
719 libtool \
720 libpcap-dev \
721 libnet1-dev \
722 libyaml-0-2 \
723 libyaml-dev \
724 libcap-ng-dev \
725 libcap-ng0 \
726 libmagic-dev \
727 libnetfilter-queue-dev \
728 libnetfilter-queue1 \
729 libnfnetlink-dev \
730 libnfnetlink0 \
731 libhiredis-dev \
732 libjansson-dev \
733 libevent-dev \
734 libevent-pthreads-2.1.6 \
735 libjansson-dev \
736 libpython2.7 \
737 make \
738 parallel \
739 python3-yaml \
740 rustc \
741 software-properties-common \
742 zlib1g \
743 zlib1g-dev \
744 exuberant-ctags
745 - name: Install cbindgen
746 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 747 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
0ae63e85
SB
748 - uses: actions/checkout@v2
749 - uses: actions/download-artifact@v2
750 with:
751 name: prep
752 path: prep
753 - run: tar xf prep/libhtp.tar.gz
754 - run: ./autogen.sh
8b38db4a 755 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-debug-validation
0ae63e85
SB
756 - run: make -j2
757 - run: make check
758 - name: Extracting suricata-verify
759 run: tar xf prep/suricata-verify.tar.gz
760 - name: Running suricata-verify
761 run: python3 ./suricata-verify/run.py
762
3887f8d1
JI
763 ubuntu-18-04:
764 name: Ubuntu 18.04 (Cocci)
765 runs-on: ubuntu-18.04
b9515671 766 container: ubuntu:18.04
ced66563 767 needs: prep
3887f8d1
JI
768 steps:
769
770 # Cache Rust stuff.
771 - name: Cache cargo registry
772 uses: actions/cache@v1
773 with:
774 path: ~/.cargo/registry
775 key: cargo-registry
776
777 - name: Install dependencies
778 run: |
b9515671
JI
779 apt update
780 apt -y install \
3887f8d1
JI
781 libpcre3 \
782 libpcre3-dev \
783 build-essential \
784 autoconf \
785 automake \
b9515671
JI
786 git \
787 jq \
3887f8d1
JI
788 libtool \
789 libpcap-dev \
790 libnet1-dev \
791 libyaml-0-2 \
792 libyaml-dev \
793 libcap-ng-dev \
794 libcap-ng0 \
795 libmagic-dev \
796 libnetfilter-queue-dev \
797 libnetfilter-queue1 \
798 libnfnetlink-dev \
799 libnfnetlink0 \
800 libhiredis-dev \
801 libjansson-dev \
802 libevent-dev \
803 libevent-pthreads-2.1.6 \
804 libjansson-dev \
b9515671 805 libpython2.7 \
3887f8d1
JI
806 make \
807 parallel \
b9515671
JI
808 python3-yaml \
809 rustc \
3887f8d1
JI
810 software-properties-common \
811 zlib1g \
9b5ccbe4
PA
812 zlib1g-dev \
813 exuberant-ctags
bcbd8c2a
JI
814 - name: Install packages for generating documentation
815 run: |
816 DEBIAN_FRONTEND=noninteractive apt -y install \
817 sphinx-doc \
818 sphinx-common \
819 texlive-latex-base \
820 texlive-fonts-recommended \
821 texlive-fonts-extra \
822 texlive-latex-extra
3887f8d1
JI
823 - name: Install Coccinelle
824 run: |
b9515671
JI
825 add-apt-repository -y ppa:npalix/coccinelle
826 apt -y install coccinelle
b573c16d 827 - name: Install cbindgen
4318c1de 828 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 829 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
ced66563
JI
830 - uses: actions/checkout@v2
831 - uses: actions/download-artifact@v2
832 with:
833 name: prep
834 path: prep
835 - run: tar xf prep/libhtp.tar.gz
3887f8d1 836 - run: ./autogen.sh
8b38db4a 837 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-coccinelle
3887f8d1 838 - run: make -j2
9b5ccbe4 839 - run: make tags
3887f8d1
JI
840 - name: Running unit tests and cocci checks
841 # Set the concurrency level for cocci.
842 run: CONCURRENCY_LEVEL=2 make check
bcbd8c2a
JI
843 - run: make dist
844 - name: Checking that documentation was built
845 run: |
846 test -e doc/devguide/devguide.pdf
847 test -e doc/userguide/userguide.pdf
848 test -e doc/userguide/suricata.1
ced66563
JI
849 - name: Extracting suricata-verify
850 run: tar xf prep/suricata-verify.tar.gz
3887f8d1 851 - name: Running suricata-verify
b9515671 852 run: python3 ./suricata-verify/run.py
3887f8d1 853
19fe8d98
VJ
854 # test build with afl and fuzztargets
855 ubuntu-18-04-fuzz:
856 name: Ubuntu 18.04 (Fuzz)
857 runs-on: ubuntu-18.04
858 container: ubuntu:18.04
ced66563 859 needs: prep
19fe8d98
VJ
860 steps:
861
862 # Cache Rust stuff.
863 - name: Cache cargo registry
864 uses: actions/cache@v1
865 with:
866 path: ~/.cargo/registry
867 key: cargo-registry
868
869 - name: Install dependencies
870 run: |
871 apt update
872 apt -y install \
873 afl \
874 afl-clang \
875 libpcre3 \
876 libpcre3-dev \
877 build-essential \
878 autoconf \
879 automake \
880 git \
881 libtool \
882 libpcap-dev \
883 libnet1-dev \
884 libyaml-0-2 \
885 libyaml-dev \
886 libcap-ng-dev \
887 libcap-ng0 \
888 libmagic-dev \
889 libnetfilter-queue-dev \
890 libnetfilter-queue1 \
891 libnfnetlink-dev \
892 libnfnetlink0 \
893 libhiredis-dev \
894 libjansson-dev \
895 libjansson-dev \
896 libpython2.7 \
897 make \
898 rustc \
899 software-properties-common \
900 zlib1g \
901 zlib1g-dev
902 - name: Install cbindgen
4318c1de 903 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 904 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
ced66563
JI
905 - uses: actions/checkout@v2
906 - uses: actions/download-artifact@v2
907 with:
908 name: prep
909 path: prep
910 - run: tar xf prep/libhtp.tar.gz
19fe8d98
VJ
911 - run: ./autogen.sh
912 - run: AFL_HARDEN=1 ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes CFLAGS="-fsanitize=address -fno-omit-frame-pointer" CXXFLAGS=$CFLAGS CC=afl-clang-fast CXX=afl-clang-fast++ ./configure --enable-fuzztargets --disable-shared
913 - run: AFL_HARDEN=1 make -j2
914
3887f8d1
JI
915 # An Ubuntu 16.04 build using the tarball generated in the CentOS 8
916 # build above.
917 ubuntu-16-04:
918 name: Ubuntu 16.04
919 runs-on: ubuntu-latest
920 container: ubuntu:16.04
921 needs: centos-8
922 steps:
923 - name: Install dependencies
924 run: |
925 apt update
926 apt -y install \
927 build-essential \
928 curl \
929 libcap-ng-dev \
930 libcap-ng0 \
931 libevent-dev \
932 libhiredis-dev \
933 libjansson-dev \
934 libmagic-dev \
935 libnet1-dev \
936 libnetfilter-queue-dev \
937 libnetfilter-queue1 \
938 libnfnetlink-dev \
939 libnfnetlink0 \
940 libnss3-dev \
941 libpcre3 \
942 libpcre3-dev \
943 libpcap-dev \
944 libyaml-0-2 \
945 libyaml-dev \
946 make \
947 python3-yaml \
948 zlib1g \
949 zlib1g-dev
950 - name: Install Rust
95e7246b 951 run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.34.2 -y
2ede7361 952 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3887f8d1 953 - name: Download suricata.tar.gz
ced66563 954 uses: actions/download-artifact@v2
3887f8d1
JI
955 with:
956 name: dist
3887f8d1 957 - name: Extract
ced66563 958 run: tar zxvf suricata-*.tar.gz --strip-components=1
3887f8d1 959 - name: Configure
8b38db4a 960 run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
3887f8d1 961 - name: Build
3887f8d1
JI
962 run: make -j2
963 - name: Testing
3887f8d1 964 run: make check
ced66563
JI
965 - run: make install
966 - run: make install-conf
967 - run: make install-rules
3887f8d1
JI
968
969 debian-10:
970 name: Debian 10
971 runs-on: ubuntu-latest
972 container: debian:10
ced66563 973 needs: prep
3887f8d1
JI
974 steps:
975 # Cache Rust stuff.
976 - name: Cache cargo registry
977 uses: actions/cache@v1
978 with:
979 path: ~/.cargo/registry
980 key: cargo-registry
981
982 - run: |
983 apt update
984 apt -y install \
985 automake \
986 autoconf \
987 build-essential \
988 ccache \
989 curl \
990 git \
991 gosu \
992 jq \
993 libpcre3 \
994 libpcre3-dbg \
995 libpcre3-dev \
996 libpcap-dev \
997 libnet1-dev \
998 libyaml-0-2 \
999 libyaml-dev \
1000 libcap-ng-dev \
1001 libcap-ng0 \
1002 libmagic-dev \
1003 libjansson-dev \
1004 libnss3-dev \
1005 libgeoip-dev \
1006 liblua5.1-dev \
1007 libhiredis-dev \
1008 libevent-dev \
1009 libtool \
1010 m4 \
1011 make \
1012 python-yaml \
1013 pkg-config \
3887f8d1
JI
1014 sudo \
1015 zlib1g \
1016 zlib1g-dev
a9249cb2
VJ
1017 - name: Install Rust
1018 run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION_KNOWN -y
1019 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
b573c16d 1020 - name: Install cbindgen
4318c1de 1021 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 1022 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
ced66563
JI
1023 - uses: actions/checkout@v2
1024 - uses: actions/download-artifact@v2
1025 with:
1026 name: prep
1027 path: prep
1028 - run: tar xf prep/libhtp.tar.gz
1029 - run: tar xf prep/suricata-update.tar.gz
3887f8d1 1030 - run: ./autogen.sh
8b38db4a 1031 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-fuzztargets
3887f8d1
JI
1032 - run: make -j2
1033 - run: make check
ced66563 1034 - run: tar xf prep/suricata-verify.tar.gz
3887f8d1
JI
1035 - name: Running suricata-verify
1036 run: ./suricata-verify/run.py
1037
1038 debian-9:
1039 name: Debian 9
1040 runs-on: ubuntu-latest
1041 container: debian:9
ced66563 1042 needs: prep
3887f8d1
JI
1043 steps:
1044 - run: |
1045 apt update
1046 apt -y install \
1047 automake \
1048 autoconf \
1049 build-essential \
1050 ccache \
1051 curl \
1052 git-core \
1053 gosu \
1054 jq \
1055 libpcre3 \
1056 libpcre3-dbg \
1057 libpcre3-dev \
1058 libpcap-dev \
1059 libnet1-dev \
1060 libyaml-0-2 \
1061 libyaml-dev \
1062 libcap-ng-dev \
1063 libcap-ng0 \
1064 libmagic-dev \
1065 libjansson-dev \
1066 libnss3-dev \
1067 libgeoip-dev \
1068 liblua5.1-dev \
1069 libhiredis-dev \
1070 libevent-dev \
1071 libtool \
1072 m4 \
1073 make \
1074 python-yaml \
1075 pkg-config \
1076 sudo \
1077 zlib1g \
1078 zlib1g-dev
1079 - name: Install Rust
cb963f86 1080 run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION_KNOWN -y
2ede7361 1081 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
b573c16d 1082 - name: Install cbindgen
4318c1de 1083 run: cargo install --force --debug --version 0.14.1 cbindgen
ced66563
JI
1084 - uses: actions/checkout@v2
1085 - uses: actions/download-artifact@v2
1086 with:
1087 name: prep
1088 path: prep
1089 - run: tar xf prep/libhtp.tar.gz
1090 - run: tar xf prep/suricata-update.tar.gz
3887f8d1 1091 - run: ./autogen.sh
8b38db4a 1092 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests
3887f8d1
JI
1093 - run: make -j2
1094 - run: make check
ced66563 1095 - run: tar xf prep/suricata-verify.tar.gz
3887f8d1
JI
1096 - name: Running suricata-verify
1097 run: ./suricata-verify/run.py
1098
1099 macos-latest:
1100 name: MacOS Latest
1101 runs-on: macos-latest
ced66563 1102 needs: prep
3887f8d1
JI
1103 steps:
1104 # Cache Rust stuff.
1105 - name: Cache cargo registry
1106 uses: actions/cache@v1
1107 with:
1108 path: ~/.cargo/registry
1109 key: cargo-registry
1110 - run: |
1111 brew install \
1112 autoconf \
1113 automake \
1114 curl \
1115 hiredis \
1116 jansson \
1117 jq \
1118 libmagic \
1119 libnet \
1120 libtool \
1121 libyaml \
1122 lua \
1123 nss \
1124 nspr \
1125 pcre \
1126 pkg-config \
1127 rust \
1128 xz
b573c16d 1129 - name: Install cbindgen
4318c1de 1130 run: cargo install --force --debug --version 0.14.1 cbindgen
2ede7361 1131 - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3887f8d1 1132 - run: pip install PyYAML
ced66563
JI
1133 - uses: actions/checkout@v2
1134 - name: Downloading prep archive
1135 uses: actions/download-artifact@v2
1136 with:
1137 name: prep
1138 path: prep
1139 - run: tar xvf prep/libhtp.tar.gz
3887f8d1 1140 - run: ./autogen.sh
8b38db4a 1141 - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests
3887f8d1
JI
1142 - run: make -j2
1143 - run: make check
ced66563 1144 - run: tar xf prep/suricata-verify.tar.gz
3887f8d1
JI
1145 - name: Running suricata-verify
1146 run: ./suricata-verify/run.py