Browse Source

TT#82051 Support GitHub actions + workflows using Debian package builds + shellcheck

Change-Id: I51c9587f819a95c1177f4e8678afea71eaaa038b
changes/93/40193/9
Michael Prokop 6 years ago
parent
commit
6e77bebb35
9 changed files with 157 additions and 0 deletions
  1. +13
    -0
      .github/actions/debpkg-buster/Dockerfile
  2. +6
    -0
      .github/actions/debpkg-buster/action.yml
  3. +16
    -0
      .github/actions/debpkg-buster/entrypoint.sh
  4. +13
    -0
      .github/actions/debpkg-sid/Dockerfile
  5. +6
    -0
      .github/actions/debpkg-sid/action.yml
  6. +16
    -0
      .github/actions/debpkg-sid/entrypoint.sh
  7. +54
    -0
      .github/workflows/debpkg.yml
  8. +30
    -0
      .github/workflows/tests.yml
  9. +3
    -0
      README.md

+ 13
- 0
.github/actions/debpkg-buster/Dockerfile View File

@ -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"]

+ 6
- 0
.github/actions/debpkg-buster/action.yml View File

@ -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'

+ 16
- 0
.github/actions/debpkg-buster/entrypoint.sh View File

@ -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' ***"

+ 13
- 0
.github/actions/debpkg-sid/Dockerfile View File

@ -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"]

+ 6
- 0
.github/actions/debpkg-sid/action.yml View File

@ -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'

+ 16
- 0
.github/actions/debpkg-sid/entrypoint.sh View File

@ -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' ***"

+ 54
- 0
.github/workflows/debpkg.yml View File

@ -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'

+ 30
- 0
.github/workflows/tests.yml View File

@ -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

+ 3
- 0
README.md View File

@ -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?
=======================


Loading…
Cancel
Save