Skip to content

Commit

Permalink
Add dockerized build.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jun 16, 2024
1 parent 724ffd0 commit 0de690c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/rtp.io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
continue-on-error: true
env:
COMPILER: ${{ matrix.compiler }}
BUILD_OS: ${{ matrix.os }}
Expand Down Expand Up @@ -75,4 +74,37 @@ jobs:
sudo make install
- name: Build rtp.io module
run: make -C modules/rtp.io
run: ONE_MODULE=rtp.io sh -x scripts/build/do_build.sh

build_in_docker:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: sippylabs/rtpproxy:latest
env:
COMPILER: clang-15
BUILD_OS: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Install git
run: |
apt-get update
apt-get install -y git lsb-release gnupg2 wget
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install dependencies
run: |
sh -x scripts/build/reset_sources.sh
sh -x scripts/build/install_depends.sh
- name: Build
run: sh -x scripts/build/do_build.sh

- name: Build rtp.io module
run: |
apt-get install -y libsrtp2-dev
ONE_MODULE=rtp.io LDFLAGS=-flto CFLAGS=-flto sh -x scripts/build/do_build.sh
11 changes: 9 additions & 2 deletions scripts/build/do_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ then
EXCLUDE_MODULES="${EXCLUDE_MODULES} ${EXCLUDE_MODULES_ADD}"
fi

CC_EXTRA_OPTS=${CC_EXTRA_OPTS:-"-Werror"} FASTER=1 NICER=0 make \
exclude_modules="${EXCLUDE_MODULES}" "${@}" ${MAKE_TGT:-"all"}
MAKE_ENV="CC_EXTRA_OPTS=${CC_EXTRA_OPTS:-"-Werror"} FASTER=1 NICER=0"
MAKE_CMD="env ${MAKE_ENV} make"

if [ ! -z "${ONE_MODULE}" ]
then
${MAKE_CMD} -C "modules/${ONE_MODULE}"
else
${MAKE_CMD} exclude_modules="${EXCLUDE_MODULES}" "${@}" ${MAKE_TGT:-"all"}
fi
2 changes: 1 addition & 1 deletion scripts/build/install_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PKGS=$(cat "$(dirname $0)/apt_requirements.txt")
_PKGS=""
for pkg in ${PKGS}
do
if [ "${BUILD_OS}" = ubuntu-22.04 -a "${pkg}" = python-dev ]
if [ "${BUILD_OS}" != ubuntu-20.04 -a "${pkg}" = python-dev ]
then
pkg="python-dev-is-python3"
fi
Expand Down
10 changes: 9 additions & 1 deletion scripts/build/reset_sources.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#!/bin/sh

. $(dirname $0)/build.conf.sub

RELEASE="$(lsb_release -cs)"
if [ "${RELEASE}" = "bookworm" ]
then
RELEASE="jammy"
fi
URL="http://archive.ubuntu.com/ubuntu"

echo "deb $URL $RELEASE main universe
deb $URL $RELEASE-updates main universe
deb $URL $RELEASE-security main universe" | sudo tee /etc/apt/sources.list > /dev/null
deb $URL $RELEASE-security main universe" | ${SUDO} tee /etc/apt/sources.list > /dev/null
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 871920D1991BC93C
gpg --export 871920D1991BC93C | ${SUDO} tee /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg > /dev/null

0 comments on commit 0de690c

Please sign in to comment.