Skip to content

Commit 0105e21

Browse files
committed
ci: make rtp.io pipeline more robust
Use GetContainerPlatforms.yml @ cimagic to pre-cache rtpproxy image. Load and pull it before the test so it does not count towards timeout.
1 parent 1f461ce commit 0105e21

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

‎.github/workflows/.rtp.io.yml‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ on:
2323
default: debian_12-slim
2424

2525
jobs:
26+
get_container_platforms:
27+
name: Get Container Platforms
28+
uses: sippy/cimagic/.github/workflows/GetContainerPlatforms.yml@v3
29+
with:
30+
image: ${{ inputs.rtpp-repo }}-${{ inputs.rtpp-tag }}
31+
2632
set_env:
2733
name: Set Environment
34+
needs: get_container_platforms
2835
runs-on: ubuntu-latest
2936
env:
30-
BASE_IMAGE: ${{ inputs.rtpp-repo }}-${{ inputs.rtpp-tag }}
37+
RAW_PLATFORMS: ${{ needs.get_container_platforms.outputs.platforms }}
3138
outputs:
3239
platforms: ${{ steps.set-env.outputs.platforms }}
3340
build-matrix: ${{ steps.set-env.outputs.build-matrix }}
@@ -42,9 +49,8 @@ jobs:
4249
id: set-env
4350
run: |
4451
BUILD_OS="`echo ${{ inputs.rtpp-tag }} | sed 's|-.*|| ; s|_|:|g'`"
45-
PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
46-
jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
47-
sort -u | grep -v unknown | BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
52+
PLATFORMS="`echo "${RAW_PLATFORMS}" | tr ',' '\n' | \
53+
BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
4854
BUILD_MATRIX="`echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' '`"
4955
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
5056
GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
@@ -273,10 +279,13 @@ jobs:
273279
echo "TEST_SET_MIGHTFAIL=early_cancel_lost100,early_cancel" >> $GITHUB_ENV
274280
fi
275281
282+
- name: Pull ${{ env.TARGETPLATFORM }} image
283+
run: docker pull --platform ${TARGETPLATFORM} ${BUILD_IMAGE}
284+
276285
- name: Test ${{ env.TARGETPLATFORM }}
277286
run: |
278-
docker pull ${BUILD_IMAGE}
279-
docker run --platform ${TARGETPLATFORM} --env TEST_SET_MIGHTFAIL --name test --cap-add=SYS_PTRACE \
287+
docker run --platform ${TARGETPLATFORM} --env TEST_SET_MIGHTFAIL \
288+
--name test --cap-add=SYS_PTRACE \
280289
--privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 ${BUILD_IMAGE}
281290
timeout-minutes: 3
282291

0 commit comments

Comments
 (0)