diff --git a/.github/workflows/.rtp.io.yml b/.github/workflows/.rtp.io.yml index 89a437f158..ac266766fd 100644 --- a/.github/workflows/.rtp.io.yml +++ b/.github/workflows/.rtp.io.yml @@ -69,6 +69,7 @@ jobs: name: Build Container (GHCR) needs: set_env runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} permissions: packages: write env: @@ -203,9 +204,9 @@ jobs: strategy: fail-fast: false matrix: - test_platform: ${{ fromJSON(needs.set_env.outputs.test-matrix) }} + platform: ${{ fromJSON(needs.set_env.outputs.test-matrix) }} env: - TARGETPLATFORM: ${{ matrix.test_platform }} + TARGETPLATFORM: ${{ matrix.platform }} BUILD_IMAGE: ${{ needs.set_env.outputs.build-image }} BUILD_OS: ${{ needs.set_env.outputs.build-os }} @@ -222,3 +223,48 @@ jobs: docker run --platform ${TARGETPLATFORM} --name test --cap-add=SYS_PTRACE \ --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 ${BUILD_IMAGE} timeout-minutes: 2 + + test_rtp_io_local: + name: Test (LOCAL) + needs: [build_rtp_io_dock_local, set_env] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: ${{ fromJSON(needs.set_env.outputs.test-matrix) }} + env: + TARGETPLATFORM: ${{ matrix.platform }} + BUILD_IMAGE: ${{ needs.set_env.outputs.build-image }} + BUILD_OS: ${{ needs.set_env.outputs.build-os }} + + steps: + - name: Set dynamic environment + id: set-env + run: | + OUTPUT_TAG="myimage:`echo ${{ matrix.platform }} | sed 's|/|-|g'`" + OUTPUT_IMAGE_N="image-${BUILD_OS}-`echo ${{ matrix.platform }} | sed 's|/|-|g'`" + OUTPUT_IMAGE="./${OUTPUT_IMAGE_N}.tar" + echo OUTPUT_TAG="${OUTPUT_TAG}" >> $GITHUB_ENV + echo OUTPUT_IMAGE="${OUTPUT_IMAGE}" >> $GITHUB_ENV + echo OUTPUT_IMAGE_N="${OUTPUT_IMAGE_N}" >> $GITHUB_ENV + + - name: Set up QEMU + if: matrix.platform != 'linux/386' && matrix.platform != 'linux/amd64' + uses: docker/setup-qemu-action@v3 + with: + platforms: ${{ env.TARGETPLATFORM }} + + - name: Download image artifact + uses: actions/download-artifact@v4 + with: + name: ${{ env.OUTPUT_IMAGE }} + path: . + + - name: Load Docker image + run: docker load -i ${{ env.OUTPUT_IMAGE_N }} + + - name: Test ${{ env.TARGETPLATFORM }} + run: | + docker run --platform ${TARGETPLATFORM} --name test --cap-add=SYS_PTRACE \ + --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 ${OUTPUT_TAG} + timeout-minutes: 2