diff --git a/.github/actions/debpkg-buster/Dockerfile b/.github/actions/debpkg-buster/Dockerfile new file mode 100644 index 000000000..19322a6a4 --- /dev/null +++ b/.github/actions/debpkg-buster/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:buster + +COPY entrypoint.sh /entrypoint.sh + +# avoid "debconf: (TERM is not set, so the dialog frontend is not usable.)" +ENV DEBIAN_FRONTEND noninteractive + +# disable man-db to speed up builds +RUN echo 'man-db man-db/auto-update boolean false' | debconf-set-selections + +RUN apt-get update && apt-get -y install build-essential + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/debpkg-buster/action.yml b/.github/actions/debpkg-buster/action.yml new file mode 100644 index 000000000..087b58f58 --- /dev/null +++ b/.github/actions/debpkg-buster/action.yml @@ -0,0 +1,6 @@ +name: "Build Docker image based on Debian/buster" +description: "Build Docker image based on Debian/buster" + +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/actions/debpkg-buster/entrypoint.sh b/.github/actions/debpkg-buster/entrypoint.sh new file mode 100755 index 000000000..8f086e19f --- /dev/null +++ b/.github/actions/debpkg-buster/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -eu -o pipefail + +echo "*** Starting execution of '$0' ***" + +echo "** Installing build dependencies **" +apt-get -y build-dep -Ppkg.ngcp-rtpengine.nobcg729 . + +echo "** Building Debian package **" +dpkg-buildpackage -Ppkg.ngcp-rtpengine.nobcg729 + +# We're inside /github/workspace/ +echo "** Copying Debian package files to workspace **" +cp ../*.deb ../*.buildinfo ../workspace/ + +echo "*** Finished execution of '$0' ***" diff --git a/.github/actions/debpkg-sid/Dockerfile b/.github/actions/debpkg-sid/Dockerfile new file mode 100644 index 000000000..375b766c3 --- /dev/null +++ b/.github/actions/debpkg-sid/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:sid + +COPY entrypoint.sh /entrypoint.sh + +# avoid "debconf: (TERM is not set, so the dialog frontend is not usable.)" +ENV DEBIAN_FRONTEND noninteractive + +# disable man-db to speed up builds +RUN echo 'man-db man-db/auto-update boolean false' | debconf-set-selections + +RUN apt-get update && apt-get -y install build-essential + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/debpkg-sid/action.yml b/.github/actions/debpkg-sid/action.yml new file mode 100644 index 000000000..1ec396a30 --- /dev/null +++ b/.github/actions/debpkg-sid/action.yml @@ -0,0 +1,6 @@ +name: "Build Docker image based on Debian/sid" +description: "Build Docker image based on Debian/sid" + +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/actions/debpkg-sid/entrypoint.sh b/.github/actions/debpkg-sid/entrypoint.sh new file mode 100755 index 000000000..8f086e19f --- /dev/null +++ b/.github/actions/debpkg-sid/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -eu -o pipefail + +echo "*** Starting execution of '$0' ***" + +echo "** Installing build dependencies **" +apt-get -y build-dep -Ppkg.ngcp-rtpengine.nobcg729 . + +echo "** Building Debian package **" +dpkg-buildpackage -Ppkg.ngcp-rtpengine.nobcg729 + +# We're inside /github/workspace/ +echo "** Copying Debian package files to workspace **" +cp ../*.deb ../*.buildinfo ../workspace/ + +echo "*** Finished execution of '$0' ***" diff --git a/.github/workflows/debpkg.yml b/.github/workflows/debpkg.yml new file mode 100644 index 000000000..8bf4c9cd7 --- /dev/null +++ b/.github/workflows/debpkg.yml @@ -0,0 +1,54 @@ +name: Debian Packaging + +on: + push: + pull_request: + schedule: + - cron: '0 8 * * *' + +jobs: + build-deb-buster: + runs-on: ubuntu-latest + name: Debian pipeline for buster + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Execute Docker debpkg action + uses: ./.github/actions/debpkg-buster + + - name: Store Debian package artifacts + uses: actions/upload-artifact@v2 + with: + name: Debian binary package files + path: '*.deb' + + - name: Store Debian package build info + uses: actions/upload-artifact@v2 + with: + name: Debian buildinfo file + path: '*.buildinfo' + + build-deb-sid: + runs-on: ubuntu-latest + name: Debian pipeline for sid + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Execute Docker debpkg action + uses: ./.github/actions/debpkg-sid + + - name: Store Debian package artifacts + uses: actions/upload-artifact@v2 + with: + name: Debian binary package files + path: '*.deb' + + - name: Store Debian package build info + uses: actions/upload-artifact@v2 + with: + name: Debian buildinfo file + path: '*.buildinfo' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..8ee5a682c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Code Testing + +on: + push: + pull_request: + schedule: + - cron: '0 8 * * *' + +jobs: + shellcheck: + runs-on: ubuntu-latest + name: Run shellcheck + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Display original shellcheck version + run: shellcheck --version + + - name: Update shellcheck to latest stable version + run: | + wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz | tar -xJv + sudo cp shellcheck-stable/shellcheck /usr/bin/ + + - name: Display current shellcheck version + run: shellcheck --version + + - name: Shellcheck execution + run: shellcheck --exclude=SC1090,SC1091 debian/*.init debian/*.post* debian/*.pre* debian/*-setup el/*.init tests/simulator-tcp.sh utils/build_deps.sh utils/patch-kernel diff --git a/README.md b/README.md index 10fef7059..b0be34790 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +![Code Testing](https://github.com/sipwise/rtpengine/workflows/Code%20Testing/badge.svg) +![Debian Package CI](https://github.com/sipwise/rtpengine/workflows/Debian%20Packaging/badge.svg) + What is rtpengine? =======================