2025-02-18 11:18:17 +01:00
|
|
|
name: libnetconf2 CI
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- devel
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- devel
|
|
|
|
|
|
|
|
env:
|
2025-02-18 11:33:30 +01:00
|
|
|
DEFAULT_PACKAGES: libcmocka-dev zlib1g-dev libssh-dev libssl-dev libpam0g-dev libcurl4-openssl-dev
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
git-branch:
|
|
|
|
name: Get git branch
|
2025-02-18 11:33:30 +01:00
|
|
|
runs-on: ubuntu-latest
|
2025-02-18 11:18:17 +01:00
|
|
|
outputs:
|
|
|
|
branch-name: ${{ steps.get-git-branch.outputs.branch-name }}
|
|
|
|
steps:
|
|
|
|
- id: get-git-branch
|
|
|
|
run: |
|
|
|
|
if ${{ github.event_name == 'push' }}
|
|
|
|
then export GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
|
|
|
|
else
|
|
|
|
export GIT_BRANCH=${{ github.base_ref }}
|
|
|
|
fi
|
2025-02-18 11:33:30 +01:00
|
|
|
echo "branch-name=$GIT_BRANCH" >> $GITHUB_OUTPUT
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.config.name }}
|
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
needs: git-branch
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "Release, gcc, OpenSSL",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Release",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "gcc",
|
|
|
|
options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON",
|
2025-02-18 11:33:30 +01:00
|
|
|
tls-lib: "OpenSSL",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "Release, gcc, MbedTLS",
|
|
|
|
os: "ubuntu-22.04",
|
|
|
|
build-type: "Release",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "gcc",
|
|
|
|
options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON",
|
|
|
|
tls-lib: "MbedTLS",
|
|
|
|
packages: "",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
name: "Release, clang",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Release",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "clang",
|
|
|
|
options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON",
|
2025-02-18 11:33:30 +01:00
|
|
|
tls-lib: "OpenSSL",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "Debug, gcc, OpenSSL",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Debug",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "gcc",
|
|
|
|
options: "-DENABLE_DNSSEC=ON",
|
2025-02-18 11:33:30 +01:00
|
|
|
tls-lib: "OpenSSL",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "valgrind",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "Debug, gcc, MbedTLS",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Debug",
|
|
|
|
dep-build-type: "Release",
|
2025-02-18 11:33:30 +01:00
|
|
|
cc: "gcc",
|
2025-02-18 11:18:17 +01:00
|
|
|
options: "-DENABLE_DNSSEC=ON",
|
2025-02-18 11:33:30 +01:00
|
|
|
tls-lib: "MbedTLS",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "valgrind",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "Debug, clang",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Debug",
|
|
|
|
dep-build-type: "Release",
|
2025-02-18 11:33:30 +01:00
|
|
|
cc: "clang",
|
|
|
|
options: "-DENABLE_DNSSEC=ON",
|
|
|
|
tls-lib: "OpenSSL",
|
|
|
|
# no valgrind because it does not support DWARF5 yet generated by clang 14
|
|
|
|
packages: "",
|
2025-02-18 11:18:17 +01:00
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "No SSH nor TLS",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Debug",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "gcc",
|
2025-02-18 11:33:30 +01:00
|
|
|
options: "-DENABLE_SSH_TLS=OFF",
|
|
|
|
tls-lib: "",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "valgrind",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "ASAN and UBSAN, OpenSSL",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Debug",
|
|
|
|
dep-build-type: "Release",
|
2025-02-18 11:33:30 +01:00
|
|
|
cc: "clang",
|
|
|
|
options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF",
|
|
|
|
tls-lib: "OpenSSL",
|
|
|
|
packages: "",
|
2025-02-18 11:18:17 +01:00
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
2025-02-18 11:33:30 +01:00
|
|
|
name: "ASAN and UBSAN, MbedTLS",
|
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "Debug",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "clang",
|
|
|
|
options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF",
|
2025-02-18 11:33:30 +01:00
|
|
|
tls-lib: "MbedTLS",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
name: "ABI Check",
|
2025-02-18 11:33:30 +01:00
|
|
|
os: "ubuntu-22.04",
|
2025-02-18 11:18:17 +01:00
|
|
|
build-type: "ABICheck",
|
|
|
|
dep-build-type: "Debug",
|
|
|
|
cc: "gcc",
|
|
|
|
options: "",
|
2025-02-18 11:33:30 +01:00
|
|
|
tls-lib: "OpenSSL",
|
2025-02-18 11:18:17 +01:00
|
|
|
packages: "abi-dumper abi-compliance-checker snap",
|
|
|
|
snaps: "core universal-ctags",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: "abi-check"
|
|
|
|
}
|
2025-02-18 11:33:30 +01:00
|
|
|
- {
|
|
|
|
name: "DEB Package",
|
|
|
|
os: "ubuntu-22.04",
|
|
|
|
build-type: "Release",
|
|
|
|
dep-build-type: "Release",
|
|
|
|
cc: "gcc",
|
|
|
|
options: "",
|
|
|
|
tls-lib: "OpenSSL",
|
|
|
|
packages: "cmake debhelper valgrind python3-pip",
|
|
|
|
snaps: "",
|
|
|
|
make-prepend: "",
|
|
|
|
make-target: ""
|
|
|
|
}
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
steps:
|
2025-02-18 11:33:30 +01:00
|
|
|
- uses: actions/checkout@main
|
|
|
|
with:
|
|
|
|
fetch-depth: 100
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Deps-packages
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
|
|
|
|
if ${{ matrix.config.snaps != '' }}
|
|
|
|
then sudo snap refresh; sudo snap install ${{ matrix.config.snaps }}
|
|
|
|
fi
|
2025-02-18 11:33:30 +01:00
|
|
|
if ${{ matrix.config.name == 'DEB Package' }}; then
|
|
|
|
pip install apkg
|
|
|
|
apkg system-setup
|
|
|
|
fi
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Deps-uncrustify
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
2025-02-18 11:33:30 +01:00
|
|
|
git clone --branch uncrustify-0.77.1 https://github.com/uncrustify/uncrustify
|
2025-02-18 11:18:17 +01:00
|
|
|
cd uncrustify
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
CC=${{ matrix.config.cc }} cmake ..
|
|
|
|
make
|
|
|
|
sudo make install
|
2025-02-18 11:33:30 +01:00
|
|
|
if: ${{ matrix.config.name == 'Debug, gcc, OpenSSL' || matrix.config.name == 'Debug, gcc, MbedTLS' }}
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Deps-libyang
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2025-02-18 11:33:30 +01:00
|
|
|
git clone -b ${{ needs.git-branch.outputs.branch-name }} https://github.com/CESNET/libyang.git
|
2025-02-18 11:18:17 +01:00
|
|
|
cd libyang
|
2025-02-18 11:33:30 +01:00
|
|
|
if ${{ matrix.config.name == 'DEB Package' }}; then
|
|
|
|
apkg build
|
|
|
|
apkg install
|
|
|
|
else
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.dep-build-type }} -DENABLE_TESTS=OFF ..
|
|
|
|
make -j2
|
|
|
|
sudo make install
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Build-and-install-package
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
|
|
|
apkg build
|
|
|
|
apkg install
|
|
|
|
if: ${{ matrix.config.name == 'DEB Package' }}
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Deps-libval
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/DNSSEC-Tools/DNSSEC-Tools.git dnssec-tools
|
|
|
|
cd dnssec-tools/dnssec-tools/validator
|
|
|
|
./configure
|
|
|
|
make -j2
|
|
|
|
sudo make install
|
2025-02-18 11:33:30 +01:00
|
|
|
if: ${{ matrix.config.name != 'DEB Package' }}
|
|
|
|
|
|
|
|
- name: Deps-MbedTLS
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git clone -b mbedtls-3.5.2 https://github.com/Mbed-TLS/mbedtls.git
|
|
|
|
cd mbedtls
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
CC=${{ matrix.config.cc }} cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On -DENABLE_TESTING=Off ..
|
|
|
|
make -j2
|
|
|
|
sudo make install
|
|
|
|
if: ${{ matrix.config.tls-lib == 'MbedTLS' }}
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} ..
|
2025-02-18 11:33:30 +01:00
|
|
|
if: ${{ matrix.config.name != 'DEB Package' }}
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/build
|
|
|
|
run: |
|
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
export PATH=/snap/bin:${{ github.workspace }}/coverity-tools/bin:$PATH
|
|
|
|
${{ matrix.config.make-prepend }} make ${{ matrix.config.make-target }}
|
2025-02-18 11:33:30 +01:00
|
|
|
if: ${{ matrix.config.name != 'DEB Package' }}
|
2025-02-18 11:18:17 +01:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/build
|
2025-02-18 11:33:30 +01:00
|
|
|
run: |
|
|
|
|
export LSAN_OPTIONS=suppressions=${{ github.workspace }}/tests/library_lsan.supp
|
|
|
|
ctest -j4 --output-on-failure
|
|
|
|
if: ${{ matrix.config.name != 'DEB Package' }}
|