Merge pull request #86 from CESNET/fdsdump-fix-missing-include #187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and tests | |
on: | |
# Ignore changes in extra plugins (as they are not tested here) | |
push: | |
paths-ignore: | |
- 'extra_plugins/**' | |
pull_request: | |
paths-ignore: | |
- 'extra_plugins/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- 'ubuntu:18.04' | |
- 'ubuntu:20.04' | |
- 'debian:stretch' | |
- 'debian:buster' | |
- 'debian:bullseye' | |
- 'centos:7' | |
- 'quay.io/centos/centos:stream8' | |
- 'oraclelinux:8' | |
- 'oraclelinux:9' | |
name: Build on ${{ matrix.image }} | |
container: ${{ matrix.image }} | |
steps: | |
# Dependencies --------------------------------------------------------------------------- | |
- name: Install dependencies for libfds and IPFIXcol2 (Ubuntu/Debian) | |
if: startsWith(matrix.image, 'ubuntu') || startsWith(matrix.image, 'debian') | |
run: | | |
apt-get update | |
apt-get -y install git gcc g++ cmake make libxml2-dev liblz4-dev libzstd-dev | |
apt-get -y install python3-docutils zlib1g-dev pkg-config | |
apt-get -y install librdkafka-dev | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
- name: Enable additional repositories (CentOS Steam) | |
if: contains(matrix.image, 'centos:stream') | |
run: | | |
dnf -y install 'dnf-command(config-manager)' | |
dnf config-manager --set-enabled appstream powertools | |
- name: Enable additional repositories (Oracle Linux 8) | |
if: contains(matrix.image, 'oraclelinux:8') | |
run: | | |
dnf -y install 'dnf-command(config-manager)' | |
dnf config-manager --set-enabled ol8_appstream ol8_codeready_builder | |
- name: Enable additional repositories (Oracle Linux 9) | |
if: contains(matrix.image, 'oraclelinux:9') | |
run: | | |
dnf -y install 'dnf-command(config-manager)' | |
dnf config-manager --set-enabled ol9_appstream ol9_codeready_builder | |
- name: Enable EPEL (CentOS) | |
if: contains(matrix.image, 'centos') | |
run: | | |
yum -y install epel-release | |
- name: Enable EPEL (Oracle Linux 8) | |
if: contains(matrix.image, 'oraclelinux:8') | |
run: | | |
dnf -y install oracle-epel-release-el8 | |
- name: Enable EPEL (Oracle Linux 9) | |
if: contains(matrix.image, 'oraclelinux:9') | |
run: | | |
dnf -y install oracle-epel-release-el9 | |
- name: Install dependencies for libfds and IPFIXcol2 (CentOS, Oracle Linux) | |
if: contains(matrix.image, 'centos') || contains(matrix.image, 'oraclelinux') | |
run: | | |
yum -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel | |
yum -y install zlib-devel pkgconfig librdkafka-devel | |
yum -y install python3-docutils || yum -y install python-docutils | |
# Checkout repository -------------------------------------------------------------------- | |
- uses: actions/checkout@v2 | |
# Build libfds library ------------------------------------------------------------------ | |
# Note: Master against master branch. Otherwise against debug branch. | |
- name: Checkout libfds library - master branch | |
if: github.ref == 'refs/heads/master' | |
run: git clone --branch master https://github.com/CESNET/libfds.git libfds_build | |
- name: Checkout libfds library - devel branch | |
if: github.ref != 'refs/heads/master' | |
run: git clone --branch devel https://github.com/CESNET/libfds.git libfds_build | |
- name: Build and install libfds library | |
working-directory: libfds_build | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_INSTALL_PREFIX=/usr | |
make && make install | |
# Build and test IPFIXcol2 --------------------------------------------------------------- | |
- name: Build and install IPFIXcol2 | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=$TESTS | |
make && make install | |
env: | |
TESTS: ${{ startsWith(matrix.image, 'centos:7') != true }} | |
- name: Run tests | |
if: startsWith(matrix.image, 'centos:7') != true | |
run: cd build && make test | |
- name: Try to run IPFIXcol2 | |
run: | | |
ipfixcol2 -V | |
ipfixcol2 -h | |
ipfixcol2 -L -v |