99 llvm-version-old :
1010 required : true
1111 type : string
12+ ghcr-repo :
13+ required : false
14+ type : string
15+ default : ghcr.io/${{ github.repository_owner }}/opensips
1216 rtpp-repo :
1317 required : false
1418 type : string
2933 build-matrix : ${{ steps.set-env.outputs.build-matrix }}
3034 test-matrix : ${{ steps.set-env.outputs.test-matrix }}
3135 build-os : ${{ steps.set-env.outputs.build-os }}
36+ build-image : ${{ steps.set-env.outputs.build-image }}
37+ git-branch : ${{ steps.set-env.outputs.git-branch }}
3238 steps :
3339 - uses : actions/checkout@v4
3440
4046 jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
4147 sort -u | grep -v unknown | BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
4248 BUILD_MATRIX="`echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' '`"
49+ GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
50+ GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
51+ BI_BRANCH="`echo ${GIT_BRANCH} | sed 's~/~_~g'`"
52+ BUILD_IMAGE="${{ inputs.ghcr-repo }}:rtp.io-${{ inputs.rtpp-tag }}-${BI_BRANCH}"
4353 echo "Platforms: ${PLATFORMS}"
4454 for _p in `echo ${PLATFORMS} | tr ',' '\n'`; \
4555 do \
@@ -53,11 +63,75 @@ jobs:
5363 echo "build-matrix=${BUILD_MATRIX}" >> $GITHUB_OUTPUT
5464 echo "test-matrix=${TEST_MATRIX}" >> $GITHUB_OUTPUT
5565 echo "build-os=${BUILD_OS}" >> $GITHUB_OUTPUT
66+ echo "build-image=${BUILD_IMAGE}" >> $GITHUB_OUTPUT
67+ echo "git-branch=${GIT_BRANCH}" >> $GITHUB_OUTPUT
5668
5769 build_rtp_io_dock :
58- name : Build Container (LOCAL)
70+ name : Build Container (GHCR)
71+ needs : set_env
72+ runs-on : ubuntu-latest
73+ if : ${{ github.event_name != 'pull_request' }}
74+ permissions :
75+ packages : write
76+ env :
77+ BASE_IMAGE : ${{ inputs.rtpp-repo }}-${{ inputs.rtpp-tag }}
78+ BUILD_OS : ${{ needs.set_env.outputs.build-os }}
79+ PLATFORMS : ${{ needs.set_env.outputs.platforms }}
80+ BUILD_IMAGE : ${{ needs.set_env.outputs.build-image }}
81+
82+ steps :
83+ - uses : actions/checkout@v4
84+ with :
85+ submodules : recursive
86+
87+ - name : Checkout VoIPTests repo
88+ uses : actions/checkout@v4
89+ with :
90+ repository : ' sippy/voiptests'
91+ path : dist/voiptests
92+
93+ - name : Checkout RTPProxy repo
94+ uses : actions/checkout@v4
95+ with :
96+ repository : ' sippy/rtpproxy'
97+ path : dist/rtpproxy
98+
99+ - name : Set up QEMU
100+ uses : docker/setup-qemu-action@v3
101+
102+ - name : Set up Docker Buildx
103+ uses : docker/setup-buildx-action@v3
104+
105+ - name : Login to GitHub Container Registry
106+ uses : docker/login-action@v3
107+ with :
108+ registry : ghcr.io
109+ username : ${{ github.repository_owner }}
110+ password : ${{ secrets.GITHUB_TOKEN }}
111+
112+ - name : Build Docker image
113+ uses : docker/build-push-action@v6
114+ env :
115+ CACHE_SPEC : " type=registry,ref=${{ env.BUILD_IMAGE }}-buildcache"
116+ with :
117+ context : .
118+ file : ./docker/Dockerfile.rtp.io
119+ build-args : |
120+ BASE_IMAGE=${{ env.BASE_IMAGE }}
121+ BUILD_OS=${{ env.BUILD_OS }}
122+ LLVM_VER=${{ inputs.llvm-version }}
123+ LLVM_VER_OLD=${{ inputs.llvm-version-old }}
124+ platforms : ${{ env.PLATFORMS }}
125+ cache-from : ${{ env.CACHE_SPEC }}
126+ cache-to : ${{ env.CACHE_SPEC }},mode=max
127+ tags : ${{ env.BUILD_IMAGE }}
128+ push : true
129+
130+ build_rtp_io_dock_local :
131+ name : Build Container (Local)
59132 needs : set_env
60133 runs-on : ubuntu-latest
134+ if : ${{ github.event_name == 'pull_request' }}
61135 strategy :
62136 fail-fast : false
63137 matrix :
@@ -128,15 +202,61 @@ jobs:
128202 path : ${{ env.OUTPUT_IMAGE }}
129203
130204 test_rtp_io_dock :
131- name : Run VoIPTests™ (LOCAL )
205+ name : Run VoIPTests™ (GHCR )
132206 needs : [build_rtp_io_dock, set_env]
133207 runs-on : ubuntu-latest
208+ if : ${{ github.event_name != 'pull_request' }}
209+ permissions :
210+ packages : read
211+ strategy :
212+ fail-fast : false
213+ matrix :
214+ platform : ${{ fromJSON(needs.set_env.outputs.test-matrix) }}
215+ env :
216+ TARGETPLATFORM : ${{ matrix.platform }}
217+ BUILD_IMAGE : ${{ needs.set_env.outputs.build-image }}
218+ BUILD_OS : ${{ needs.set_env.outputs.build-os }}
219+
220+ steps :
221+ - name : Set up QEMU
222+ if : matrix.platform != 'linux/386' && matrix.platform != 'linux/amd64'
223+ uses : docker/setup-qemu-action@v3
224+ with :
225+ platforms : ${{ env.TARGETPLATFORM }}
226+
227+ - name : Login to GitHub Container Registry
228+ uses : docker/login-action@v3
229+ with :
230+ registry : ghcr.io
231+ username : ${{ github.repository_owner }}
232+ password : ${{ secrets.GITHUB_TOKEN }}
233+
234+ - name : Set dynamic environment
235+ run : |
236+ if [ "${TARGETPLATFORM}" != "linux/amd64" ]
237+ then
238+ echo "TEST_SET_MIGHTFAIL=early_cancel_lost100,early_cancel" >> $GITHUB_ENV
239+ fi
240+
241+ - name : Test ${{ env.TARGETPLATFORM }}
242+ run : |
243+ docker pull ${BUILD_IMAGE}
244+ docker run --platform ${TARGETPLATFORM} --env TEST_SET_MIGHTFAIL --name test --cap-add=SYS_PTRACE \
245+ --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 ${BUILD_IMAGE}
246+ timeout-minutes : 3
247+
248+ test_rtp_io_local :
249+ name : Run VoIPTests™ (LOCAL)
250+ needs : [build_rtp_io_dock_local, set_env]
251+ runs-on : ubuntu-latest
252+ if : ${{ github.event_name == 'pull_request' }}
134253 strategy :
135254 fail-fast : false
136255 matrix :
137256 platform : ${{ fromJSON(needs.set_env.outputs.test-matrix) }}
138257 env :
139258 TARGETPLATFORM : ${{ matrix.platform }}
259+ BUILD_IMAGE : ${{ needs.set_env.outputs.build-image }}
140260 BUILD_OS : ${{ needs.set_env.outputs.build-os }}
141261
142262 steps :
0 commit comments