From 7c41a2c0ddfe3ff0f803d7df799e2f51e507a8d5 Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Mon, 18 Mar 2024 22:58:53 +0100 Subject: [PATCH 1/4] FRRouting + libyang build It can build for the current pull request of libyang, for some well known tags in order to have a reference too. The purpose is to ensure that libyang and FRRouting keeps working together smoothly. Currently, it is just about a compilation and link test. In order to work with pre-set tags/versions, the fork should the tags. If they are missing, you can catch up those tags using: $ git remote -v origin git@github.com:vjardin/libyang.git (fetch) origin git@github.com:vjardin/libyang.git (push) upstream git@github.com:CESNET/libyang.git (fetch) upstream git@github.com:CESNET/libyang.git (push) $ git fetch --tags upstream $ git tag -l $ git push --tags origin --- .github/workflows/frr-checks.yml | 111 +++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .github/workflows/frr-checks.yml diff --git a/.github/workflows/frr-checks.yml b/.github/workflows/frr-checks.yml new file mode 100644 index 000000000..5fd768111 --- /dev/null +++ b/.github/workflows/frr-checks.yml @@ -0,0 +1,111 @@ +name: libyang+FRR HEAD CI +run-name: libyang CI FRR ${{ github.actor }} ⚗️ +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' +jobs: + build-frr: + name: Build FRR + runs-on: ubuntu-latest + strategy: + matrix: + compiler: [ gcc ] + frr-versions: [ master ] + libyang-versions: + - v2.1.128 + - ${{ github.ref_name }} + steps: + - name: add missing packages per building-frr-for-ubuntu2204 + uses: ConorMacBride/install-package@v1 + with: + apt: + git + autoconf + libtool + make + libreadline-dev + texinfo + pkg-config + libelf-dev + libpam0g-dev + libjson-c-dev + bison + flex + libc-ares-dev + python3-dev + python3-sphinx + install-info + build-essential + libsnmp-dev + perl + libcap-dev + libelf-dev + libunwind-dev + protobuf-c-compiler + libprotobuf-c-dev + libgrpc++-dev + protobuf-compiler-grpc + libsqlite3-dev + libzmq5 + libzmq3-dev + - name: libyang ${{ matrix.libyang-versions }} ${{ matrix.compiler }} + uses: actions/checkout@v4 + with: + ref: ${{ matrix.libyang-versions }} + submodules: false + fetch-depth: 0 + filter: tree:0 + fetch-tags: true + - name: make libyang from upstream + run: >- + git branch && + mkdir build && + cd build && + export CC=${{ matrix.compiler }} && + cmake -DCMAKE_BUILD_TYPE:String="Release" .. && + make -j $(nproc) && + sudo make install + - name: Add FRR user and groups + run: >- + sudo groupadd -r -g 92 frr && + sudo groupadd -r -g 85 frrvty && + sudo adduser --system --ingroup frr --home /var/run/frr/ --gecos "FRR suite" --shell /sbin/nologin frr && + sudo usermod -a -G frrvty frr + - name: FRR github checkout + uses: actions/checkout@v4 + with: + repository: 'FRRouting/frr.git' + ref: ${{ matrix.frr-versions }} + fetch-tags: true + submodules: false + - name: compile FRR with ${{ matrix.libyang-versions }} ${{ matrix.compiler }} + run: >- + ls -la && + export CC=${{ matrix.compiler }} && + ./bootstrap.sh && + ./configure \ + --prefix=/usr \ + --includedir=\${prefix}/include \ + --bindir=\${prefix}/bin \ + --sbindir=\${prefix}/lib/frr \ + --libdir=\${prefix}/lib/frr \ + --libexecdir=\${prefix}/lib/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-moduledir=\${prefix}/lib/frr/modules \ + --enable-configfile-mask=0640 \ + --enable-logfile-mask=0640 \ + --enable-snmp=agentx \ + --enable-multipath=64 \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --with-pkg-git-version \ + --with-pkg-extra-version=-MyOwnFRRVersion && + make -j $(nproc) && + sudo make install + continue-on-error: true From 10f73902ac61ab79bdefc5dbbc8ab32eeb2f572c Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Tue, 19 Mar 2024 11:05:27 +0100 Subject: [PATCH 2/4] FRR+libyang: yell on failures Even if a build fails, we'd like to continue on failures. But in case of a failure it needs to yell that it does not succeed. apply the mustache rule per: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions --- .github/workflows/frr-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frr-checks.yml b/.github/workflows/frr-checks.yml index 5fd768111..b83b8afa4 100644 --- a/.github/workflows/frr-checks.yml +++ b/.github/workflows/frr-checks.yml @@ -83,6 +83,7 @@ jobs: fetch-tags: true submodules: false - name: compile FRR with ${{ matrix.libyang-versions }} ${{ matrix.compiler }} + if: ${{ always() }} run: >- ls -la && export CC=${{ matrix.compiler }} && @@ -108,4 +109,3 @@ jobs: --with-pkg-extra-version=-MyOwnFRRVersion && make -j $(nproc) && sudo make install - continue-on-error: true From 8d644cacd88224c4e6dc2a38320e3c1d65a4402e Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Tue, 19 Mar 2024 11:39:51 +0100 Subject: [PATCH 3/4] FRRouting: matrix of many tags/versions Let's have a symetric design for libyang and FRRouting. --- .github/workflows/frr-checks.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frr-checks.yml b/.github/workflows/frr-checks.yml index b83b8afa4..1e8b0df3b 100644 --- a/.github/workflows/frr-checks.yml +++ b/.github/workflows/frr-checks.yml @@ -14,7 +14,8 @@ jobs: strategy: matrix: compiler: [ gcc ] - frr-versions: [ master ] + frr-versions: + - master libyang-versions: - v2.1.128 - ${{ github.ref_name }} @@ -80,8 +81,10 @@ jobs: with: repository: 'FRRouting/frr.git' ref: ${{ matrix.frr-versions }} - fetch-tags: true submodules: false + fetch-depth: 0 + filter: tree:0 + fetch-tags: true - name: compile FRR with ${{ matrix.libyang-versions }} ${{ matrix.compiler }} if: ${{ always() }} run: >- From c55da0ec879fdd1b1aa81d7b89048ae0bb8701a8 Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Tue, 19 Mar 2024 11:43:53 +0100 Subject: [PATCH 4/4] Build libyang+FRRouting from libyang pull request Drop the explicit version v2.1.128 to avoid running it on every pull request/push. A scheduled run on specific tags will be provided by a later commit. Suggested-by: Michal Vasko --- .github/workflows/frr-checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/frr-checks.yml b/.github/workflows/frr-checks.yml index 1e8b0df3b..097dfbeae 100644 --- a/.github/workflows/frr-checks.yml +++ b/.github/workflows/frr-checks.yml @@ -17,7 +17,6 @@ jobs: frr-versions: - master libyang-versions: - - v2.1.128 - ${{ github.ref_name }} steps: - name: add missing packages per building-frr-for-ubuntu2204