Skip to content

Commit 27e2fad

Browse files
committed
github-ci: add almalinux 10 build
Instead of a separate job, include template testing based on the AlmaLinux 9 template job.
1 parent 6bbba95 commit 27e2fad

1 file changed

Lines changed: 200 additions & 0 deletions

File tree

.github/workflows/builds.yml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,206 @@ jobs:
6767
name: cbindgen
6868
path: .
6969

70+
almalinux-10:
71+
name: AlmaLinux 10 (doc, plugins, schema)
72+
runs-on: ubuntu-latest
73+
container: almalinux:10
74+
needs: [prepare-deps, prepare-cbindgen]
75+
steps:
76+
# Cache Rust stuff.
77+
- name: Cache cargo registry
78+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
79+
with:
80+
path: ~/.cargo/registry
81+
key: cargo-registry
82+
83+
- name: Determine number of CPUs
84+
run: echo CPUS=$(nproc --all) >> $GITHUB_ENV
85+
86+
- name: Install system packages
87+
run: |
88+
dnf -y install dnf-plugins-core epel-release
89+
dnf config-manager --set-enabled crb
90+
dnf -y install \
91+
autoconf \
92+
automake \
93+
cargo-vendor \
94+
cbindgen \
95+
diffutils \
96+
numactl-devel \
97+
dpdk-devel \
98+
file-devel \
99+
gcc \
100+
gcc-c++ \
101+
git \
102+
hwloc \
103+
hwloc-devel \
104+
jansson-devel \
105+
jq \
106+
libtool \
107+
libyaml-devel \
108+
libnfnetlink-devel \
109+
libnetfilter_queue-devel \
110+
libnet-devel \
111+
libcap-ng-devel \
112+
libevent-devel \
113+
libmaxminddb-devel \
114+
libpcap-devel \
115+
libtool \
116+
lz4-devel \
117+
make \
118+
pcre2-devel \
119+
pkgconfig \
120+
python3-devel \
121+
python3-sphinx \
122+
python3-yaml \
123+
rust-toolset \
124+
sudo \
125+
which \
126+
zlib-devel
127+
# These packages required to build the PDF.
128+
dnf -y install \
129+
texlive-latex \
130+
texlive-cmap \
131+
texlive-collection-latexrecommended \
132+
texlive-fncychap \
133+
texlive-titlesec \
134+
texlive-tabulary \
135+
texlive-framed \
136+
texlive-wrapfig \
137+
texlive-upquote \
138+
texlive-capt-of \
139+
texlive-needspace
140+
141+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
142+
- run: git config --global --add safe.directory /__w/suricata/suricata
143+
- uses: ./.github/actions/install-cbindgen
144+
# Download and extract dependency archives created during prep
145+
# job.
146+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
147+
with:
148+
name: prep
149+
path: prep
150+
- run: tar xvf prep/suricata-update.tar.gz
151+
- run: tar xvf prep/suricata-verify.tar.gz
152+
- name: Configuring
153+
run: |
154+
./autogen.sh
155+
CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-warnings
156+
- run: make -j ${{ env.CPUS }} distcheck
157+
env:
158+
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
159+
MAKEFLAGS: "-j ${{ env.CPUS }}"
160+
161+
- name: Check that man page was built
162+
run: test -e doc/userguide/suricata.1
163+
164+
- name: Checking un-needed includes
165+
run: |
166+
cppclean src/*.h | grep "does not need to be #included" | python3 scripts/cppclean_check.py
167+
168+
- name: Building Rust documentation
169+
run: make doc
170+
working-directory: rust
171+
172+
# Test install.
173+
- run: make install install-conf
174+
- run: suricatasc -h
175+
- run: suricata-update -V
176+
- name: Check if Suricata-Update example configuration files are installed
177+
run: |
178+
test -e /usr/local/lib/suricata/python/suricata/update/configs/disable.conf
179+
test -e /usr/local/lib/suricata/python/suricata/update/configs/drop.conf
180+
test -e /usr/local/lib/suricata/python/suricata/update/configs/enable.conf
181+
test -e /usr/local/lib/suricata/python/suricata/update/configs/modify.conf
182+
test -e /usr/local/lib/suricata/python/suricata/update/configs/threshold.in
183+
test -e /usr/local/lib/suricata/python/suricata/update/configs/update.yaml
184+
185+
- name: Test capture plugin
186+
working-directory: examples/plugins/ci-capture
187+
run: |
188+
make
189+
../../../src/suricata -S /dev/null --set plugins.0=./capture.so --capture-plugin=ci-capture --runmode=single -l . -c ../../../suricata.yaml
190+
cat eve.json | jq -c 'select(.dns)'
191+
test $(cat eve.json | jq -c 'select(.dns)' | wc -l) = "1"
192+
193+
- name: Test app-layer plugin
194+
working-directory: examples/plugins/altemplate
195+
run: |
196+
cargo build
197+
../../../src/suricata -S altemplate.rules --set plugins.0=./target/debug/libsuricata_altemplate.so --runmode=single -l . -c altemplate.yaml -k none -r ../../../rust/src/applayertemplate/template.pcap
198+
cat eve.json | jq -c 'select(.altemplate)'
199+
test $(cat eve.json | jq -c 'select(.altemplate)' | wc -l) = "3"
200+
# we get 2 alerts and 1 altemplate events
201+
202+
- name: Test library build in tree
203+
working-directory: examples/lib/simple
204+
run: make clean all
205+
206+
- name: Test plugin build in tree
207+
working-directory: examples/plugins/c-json-filetype
208+
run: make clean all
209+
210+
- name: Build example C custom logger plugin
211+
working-directory: examples/plugins/c-custom-loggers
212+
run: make clean all
213+
214+
- name: Install Suricata and library
215+
run: make install install-headers install-library
216+
217+
- name: Test library build out of tree
218+
working-directory: examples/lib/simple
219+
run: PATH=/usr/local/bin:$PATH make -f Makefile.example clean all
220+
221+
- name: Test custom lib example
222+
run: |
223+
make
224+
./custom -- ../../../qa/docker/pcaps/tls.pcap
225+
test $(cat eve.json |jq 'select(.stats) | .stats.decoder.pkts') = 110
226+
working-directory: examples/lib/custom
227+
228+
- name: Cleaning source directory for standalone plugin test.
229+
run: make clean
230+
231+
- name: Test plugin against installed headers
232+
working-directory: examples/plugins/c-json-filetype
233+
run: |
234+
# First use sed to pretend we are a user following our
235+
# directions for building a standalone plugin.
236+
sed -i 's/^#LIBSURICATA_CONFIG/LIBSURICATA_CONFIG/' Makefile
237+
sed -i 's/^#CPPFLAGS/CPPFLAGS/' Makefile
238+
sed -i 's/^CPPFLAGS.*HAVE_CONFIG_H//' Makefile
239+
240+
# And build.
241+
PATH=/usr/local/bin:$PATH make clean all
242+
243+
- name: Check EVE schema ordering
244+
run: ./scripts/schema-sort.py --check ./etc/schema.json
245+
246+
- name: Test suricata-update
247+
run: suricata-update
248+
249+
# Template testing from AlmaLinux 9
250+
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.85.0 -y
251+
- run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
252+
- run: rustup component add rustfmt
253+
- run: rustup component add clippy
254+
- name: Build for template testing
255+
run: |
256+
./autogen.sh
257+
CFLAGS="${DEFAULT_CFLAGS}" ./configure
258+
make -j ${{ env.CPUS }}
259+
- run: ./scripts/setup-app-layer.py --parser --logger --detect FooBar payload
260+
- run: make -j ${{ env.CPUS }}
261+
- run: ./src/suricata --list-app-layer-protos | grep foobar
262+
- run: ./src/suricata --list-app-layer-hooks | grep "foobar:request_started"
263+
- name: Verify rustfmt
264+
run: rustfmt -v --check src/applayerfoobar/*.rs
265+
working-directory: rust
266+
- name: Verify clippy
267+
run: cargo clippy --all-features
268+
working-directory: rust
269+
70270
almalinux-9:
71271
name: AlmaLinux 9 (schema)
72272
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)