Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 68 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ on:
- devel

jobs:
git-branch:
name: Get git branch
runs-on: ubuntu-latest
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
echo "branch-name=$GIT_BRANCH" >> $GITHUB_OUTPUT

build-unix:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
Expand All @@ -25,9 +40,7 @@ jobs:
options: "-DENABLE_TESTS=ON",
packager: "sudo apt-get",
# no expect because stdout seems to be redirected
packages: "libcmocka-dev libxxhash-dev libcbor-dev",
snaps: "",
build-cmd: "make"
packages: "libcmocka-dev libxxhash-dev libcbor-dev"
}
- {
name: "Release, clang",
Expand All @@ -36,9 +49,7 @@ jobs:
cc: "clang",
options: "-DENABLE_TESTS=ON",
packager: "sudo apt-get",
packages: "libcmocka-dev libxxhash-dev libcbor-dev",
snaps: "",
build-cmd: "make"
packages: "libcmocka-dev libxxhash-dev libcbor-dev"
}
- {
name: "Debug, gcc",
Expand All @@ -47,9 +58,7 @@ jobs:
cc: "gcc",
options: "",
packager: "sudo apt-get",
packages: "libcmocka-dev libxxhash-dev libcbor-dev uncrustify valgrind",
snaps: "",
build-cmd: "make"
packages: "libcmocka-dev libxxhash-dev libcbor-dev uncrustify valgrind"
}
- {
name: "Debug, clang",
Expand All @@ -59,9 +68,7 @@ jobs:
options: "",
packager: "sudo apt-get",
# no valgrind because it does not support DWARF5 yet generated by clang 14
packages: "libcmocka-dev libxxhash-dev libcbor-dev",
snaps: "",
build-cmd: "make"
packages: "libcmocka-dev libxxhash-dev libcbor-dev"
}
- {
name: "Release, macOS, clang",
Expand All @@ -70,9 +77,7 @@ jobs:
cc: "clang",
options: "-DENABLE_TESTS=ON -DPATH_EXPECT=",
packager: "brew",
packages: "cmocka xxhash tcl-tk libcbor",
snaps: "",
build-cmd: "make"
packages: "cmocka xxhash tcl-tk libcbor"
}
- {
name: "ASAN and UBSAN",
Expand All @@ -81,20 +86,7 @@ jobs:
cc: "clang",
options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF",
packager: "sudo apt-get",
packages: "libcmocka-dev libxxhash-dev libcbor-dev",
snaps: "",
build-cmd: "make"
}
- {
name: "DEB Package",
os: "ubuntu-latest",
build-type: "Release",
cc: "gcc",
options: "",
packager: "sudo apt-get",
packages: "cmake debhelper libcmocka-dev libxxhash-dev python3-pip",
snaps: "",
build-cmd: ""
packages: "libcmocka-dev libxxhash-dev libcbor-dev"
}

steps:
Expand All @@ -109,19 +101,6 @@ jobs:
if ${{ matrix.config.packages != '' }}
then ${{ matrix.config.packager }} install ${{ matrix.config.packages }}
fi
if ${{ matrix.config.snaps != '' }}
then sudo snap install ${{ matrix.config.snaps }}
fi

- name: Build-and-install-package
shell: bash
working-directory: ${{ github.workspace }}
run: |
pip install apkg
apkg system-setup
apkg build
apkg install
if: ${{ matrix.config.name == 'DEB Package' }}

- name: Configure
shell: bash
Expand All @@ -130,22 +109,19 @@ jobs:
mkdir build
cd build
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} ..
if: ${{ matrix.config.name != 'DEB Package' }}

- 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.build-cmd }}
if: ${{ matrix.config.name != 'DEB Package' }}
make

- name: Test
shell: bash
working-directory: ${{ github.workspace }}/build
run: ctest --output-on-failure
if: ${{ matrix.config.name != 'DEB Package' }}

build-windows:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -335,3 +311,49 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ..
make
ctest --output-on-failure

build-packages:
name: ${{ matrix.config.name }}
runs-on: ubuntu-latest
needs: git-branch
strategy:
fail-fast: false
matrix:
config:
- {
name: "RPM build, Rocky Linux 9",
image: "rockylinux:9",
pkg-setup: "",
pkg-cmd: "dnf -y --enablerepo=crb --enablerepo=devel install",
pkg-packages: "python3-pip cmake gcc git doxygen libcmocka-devel pcre2-devel libcbor-devel xxhash-devel",
pipx-install: "python3 -m pip install pipx"
}
- {
name: "DEB build, Debian 13",
image: "debian:13",
pkg-setup: "apt-get update -q",
pkg-cmd: "apt-get install -yq",
pkg-packages: "pipx cmake git debhelper pkg-config libcmocka-dev libpcre2-dev libcbor-dev libxxhash-dev",
pipx-install: ""
}
container:
image: ${{ matrix.config.image }}
steps:
- name: Deps-packages
run: |
${{ matrix.config.pkg-setup }}
${{ matrix.config.pkg-cmd }} ${{ matrix.config.pkg-packages }}
${{ matrix.config.pipx-install }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
pipx install apkg

- name: Clone-repo
run: |
git clone -b ${{ needs.git-branch.outputs.branch-name }} https://github.com/CESNET/libyang.git

- name: Build-and-install-package
run: |
apkg system-setup
cd libyang
apkg build
apkg install
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# set version of the project
set(LIBYANG_MAJOR_VERSION 6)
set(LIBYANG_MINOR_VERSION 4)
set(LIBYANG_MICRO_VERSION 26)
set(LIBYANG_MICRO_VERSION 27)
set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION})

# set version of the library
Expand Down
5 changes: 3 additions & 2 deletions distro/pkg/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Build-Depends: cmake,
debhelper (>= 10),
libcmocka-dev <!nocheck>,
libpcre2-dev,
libcbor-dev,
libxxhash-dev,
pkg-config
Vcs-Browser: https://github.com/CESNET/libyang/tree/master
Vcs-Git: https://github.com/CESNET/libyang.git
Expand All @@ -22,8 +24,7 @@ Description: parser toolkit for IETF YANG data modeling - runtime
YANG data modeling language defined by the IETF in RFCs 6020/7950.

Package: libyang-dev
Depends: libpcre2-dev,
libyang5 (= ${binary:Version}),
Depends: libyang5 (= ${binary:Version}),
${misc:Depends}
Conflicts: libyang2-dev
Section: libdevel
Expand Down
3 changes: 2 additions & 1 deletion distro/pkg/rpm/libyang.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ BuildRequires: doxygen
BuildRequires: gcc
BuildRequires: cmake(cmocka) >= 1.0.1
BuildRequires: pkgconfig(libpcre2-8) >= 10.21
BuildRequires: libcbor-devel
BuildRequires: xxhash-devel

%package modules
Summary: YANG modules for libyang

%package devel
Summary: Development files for libyang
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pcre2-devel

%package devel-doc
Summary: Documentation of libyang API
Expand Down
Loading
Loading