From b657af19052040ab7429424ae2a53dee719f71b5 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 8 Jun 2022 17:49:19 +0200 Subject: [PATCH] TT#124273 GitHub actions: use pkg script for execution Instead of having to rely on external repositories (like the ubuntu-cloud-archive/yoga-staging PPA for the debhelper v13 backport), let's use the pkg script instead. The pkg scripts ensure that the debian/ directory looks as expected for the according distribution. So for executing coverity + unit-tests in the Ubuntu/focal / ubuntu-20.04 environment on GitHub, let's use pkg/deb/backports/focal for generating the according Debian source tree. Related change in pkg: make `wrap-and-sort` execution optional. We don't have devscripts installed by default in Ubuntu/focal / ubuntu-20.04 environment on GitHub, while usage of wrap-and-sort can be considered optional for our purposes. Change-Id: Ic252b323408fab557e3f151a93f61aa8fac1a30f --- .github/workflows/coverity.yml | 9 +++++++-- .github/workflows/unit-tests.yml | 9 +++++++-- pkg/deb/backports/bookworm | 6 +++++- pkg/deb/backports/bullseye | 6 +++++- pkg/deb/backports/buster | 6 +++++- pkg/deb/backports/focal | 6 +++++- pkg/deb/backports/sid | 6 +++++- pkg/deb/backports/stretch | 6 +++++- pkg/deb/generator.sh | 12 ++++++++---- 9 files changed, 52 insertions(+), 14 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index c5bdbc4b3..e9008ee0b 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -28,8 +28,13 @@ jobs: - name: Get build dependencies run: | - # note: debhelper v13 isn't available from ubuntu-20.04 yet, we need a backport - sudo apt-add-repository -y ppa:ubuntu-cloud-archive/yoga-staging + echo "Generating Debian source for usage on Ubuntu/focal / ubuntu-20.04" + cd pkg/deb/ + ./generator.sh + ./backports/focal + rm -rf debian + mv focal debian + echo "Installing Debian packages" sudo apt-get install -q -y --no-install-recommends git ca-certificates curl sudo apt-get build-dep -q -y -Ppkg.ngcp-rtpengine.nobcg729 . diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 705135cfa..401e76d84 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -21,8 +21,13 @@ jobs: - name: Get build dependencies run: | - # note: debhelper v13 isn't available from ubuntu-20.04 yet, we need a backport - sudo apt-add-repository -y ppa:ubuntu-cloud-archive/yoga-staging + echo "Generating Debian source for usage on Ubuntu/focal / ubuntu-20.04" + cd pkg/deb/ + ./generator.sh + ./backports/focal + rm -rf debian + mv focal debian + echo "Installing Debian packages" sudo apt-get build-dep -q -y -Ppkg.ngcp-rtpengine.nobcg729 . - name: Run unit tests with sanitizers enabled diff --git a/pkg/deb/backports/bookworm b/pkg/deb/backports/bookworm index daccb34a5..a5c1f9a35 100755 --- a/pkg/deb/backports/bookworm +++ b/pkg/deb/backports/bookworm @@ -11,7 +11,11 @@ fi rm -rf ${DIST} cp -r debian ${DIST} -wrap-and-sort -sat -d ${DIST} +if command -v wrap-and-sort &>/dev/null ; then + wrap-and-sort -sat -d ${DIST} +else + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +fi # clean backports scripts rm -rf ${DIST}/backports diff --git a/pkg/deb/backports/bullseye b/pkg/deb/backports/bullseye index 3987db8c8..4de2d6784 100755 --- a/pkg/deb/backports/bullseye +++ b/pkg/deb/backports/bullseye @@ -25,7 +25,11 @@ override_dh_dwz: # Disable, as dwz cannot cope with some of the plugins generated. EOF -wrap-and-sort -sat -d ${DIST} +if command -v wrap-and-sort &>/dev/null ; then + wrap-and-sort -sat -d ${DIST} +else + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +fi # clean backports scripts rm -rf ${DIST}/backports diff --git a/pkg/deb/backports/buster b/pkg/deb/backports/buster index ad1b19487..813439c3e 100755 --- a/pkg/deb/backports/buster +++ b/pkg/deb/backports/buster @@ -28,7 +28,11 @@ override_dh_dwz: # Disable, as dwz cannot cope with some of the plugins generated. EOF -wrap-and-sort -sat -d ${DIST} +if command -v wrap-and-sort &>/dev/null ; then + wrap-and-sort -sat -d ${DIST} +else + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +fi # clean backports scripts rm -rf ${DIST}/backports diff --git a/pkg/deb/backports/focal b/pkg/deb/backports/focal index 3589ac7ae..fcd4e44e6 100755 --- a/pkg/deb/backports/focal +++ b/pkg/deb/backports/focal @@ -28,7 +28,11 @@ override_dh_dwz: # Disable, as dwz cannot cope with some of the plugins generated. EOF -wrap-and-sort -sat -d ${DIST} +if command -v wrap-and-sort &>/dev/null ; then + wrap-and-sort -sat -d ${DIST} +else + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +fi # clean backports scripts rm -rf ${DIST}/backports diff --git a/pkg/deb/backports/sid b/pkg/deb/backports/sid index 246a3ee31..88fa386b0 100755 --- a/pkg/deb/backports/sid +++ b/pkg/deb/backports/sid @@ -11,7 +11,11 @@ fi rm -rf ${DIST} cp -r debian ${DIST} -wrap-and-sort -sat -d ${DIST} +if command -v wrap-and-sort &>/dev/null ; then + wrap-and-sort -sat -d ${DIST} +else + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +fi # clean backports scripts rm -rf ${DIST}/backports diff --git a/pkg/deb/backports/stretch b/pkg/deb/backports/stretch index 6da07a260..f3d76c703 100755 --- a/pkg/deb/backports/stretch +++ b/pkg/deb/backports/stretch @@ -37,7 +37,11 @@ override_dh_systemd_start: dh_systemd_start -prtpengine-recording-daemon --name=rtpengine-recording-nfs-mount EOF -wrap-and-sort -sat -d ${DIST} +if command -v wrap-and-sort &>/dev/null ; then + wrap-and-sort -sat -d ${DIST} +else + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +fi # clean backports scripts rm -rf ${DIST}/backports diff --git a/pkg/deb/generator.sh b/pkg/deb/generator.sh index 7d5826931..c1f55c531 100755 --- a/pkg/deb/generator.sh +++ b/pkg/deb/generator.sh @@ -46,7 +46,11 @@ while read -r file; do mv "${file}" "${file_new}" done < <(find debian -maxdepth 1 -type f -name 'ngcp-rtpengine*') -echo "- Remove empty Suggests" -wrap-and-sort -sed -i -e '/Suggests:$/d' debian/control -wrap-and-sort -sat +if ! command -v wrap-and-sort &>/dev/null ; then + echo "WARN: wrap-and-sort (Debian package devscripts) not available." +else + echo "- Remove empty Suggests" + wrap-and-sort + sed -i -e '/Suggests:$/d' debian/control + wrap-and-sort -sat +fi