From 1b5fe41fc1cbdbf3c43edda554afeb640fa95661 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Wed, 4 Oct 2023 23:41:15 +0000 Subject: [PATCH] Run in docker. Run go get outside of docker. --- .github/workflows/go.yml | 10 +++++++++- scripts/travis/functions.sub | 12 ++---------- scripts/travis/test_run.sh | 4 ++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 98465aa..f3d2b05 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,5 +17,13 @@ jobs: with: go-version: 1.21.1 + - name: Pull and run build in Docker container + run: | + docker pull sippylabs/rtpproxy:latest + - name: Build - run: make + run: | + echo ${RUNNER_TOOL_CACHE} + docker run --rm -v ${RUNNER_TOOL_CACHE}:${RUNNER_TOOL_CACHE} -v ${HOME}:${HOME} -e PATH \ + -e WORKSPACE=${{ github.workspace }} --entrypoint /bin/sh sippylabs/rtpproxy:latest -c \ + 'set -e; cd ${WORKSPACE}; apt install -y gcc; go build -buildvcs=false -o rtp_cluster; ${WORKSPACE}/scripts/travis/test_run.sh' diff --git a/scripts/travis/functions.sub b/scripts/travis/functions.sub index 2f1e8c8..cc1d777 100644 --- a/scripts/travis/functions.sub +++ b/scripts/travis/functions.sub @@ -1,23 +1,15 @@ BUILDDIR="${BUILDDIR:-${BASEDIR}}" -DISTDIR="${BUILDDIR}/dist" TESTSDIR="${BASEDIR}/tests" -RTPPDDIR="${DISTDIR}/rtpproxy" SIPPY_DIR="${BASEDIR}/sippy_lite" if [ "${RTPP_TEST_VER}" = "production" ] then - RTPPROXY_BIN="${RTPPDDIR}/src/rtpproxy" + RTPPROXY_BIN="rtpproxy" else - RTPPROXY_BIN="${RTPPDDIR}/src/rtpproxy_debug" + RTPPROXY_BIN="rtpproxy_debug" fi -##if [ "${RTPP_BRANCH}" != "master" ] -##then -## RTPPDDIR_m="${RTPPDDIR}.master" -##else -## RTPPDDIR_m="${RTPPDDIR}" -##fi init_mr_time() { MR_TIME="`python ${SIPPY_DIR}/sippy/tools/getmonotime.py -S ${SIPPY_DIR} -r`" diff --git a/scripts/travis/test_run.sh b/scripts/travis/test_run.sh index 2165635..3d01b52 100755 --- a/scripts/travis/test_run.sh +++ b/scripts/travis/test_run.sh @@ -1,12 +1,16 @@ #!/bin/sh set -e +set -x BASEDIR="${BASEDIR:-$(dirname -- "${0}")/../..}" BASEDIR="$(readlink -f -- ${BASEDIR})" +SHELL="${SHELL:-"/bin/sh"}" + . ${BASEDIR}/scripts/travis/functions.sub cd ${TESTSDIR} +ls -l #init_mr_time RTPPROXY_CMD="${RTPPROXY_BIN}" exec ${SHELL} basic_network