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