Skip to content

WebRTC Peer Connection Echo Interoperability Test #156

WebRTC Peer Connection Echo Interoperability Test

WebRTC Peer Connection Echo Interoperability Test #156

name: WebRTC Peer Connection Echo Interoperability Test
on:
push:
branches:
- master
pull_request:
branches:
- master
repository_dispatch:
types: [echo-test-command]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Job Description: Builds docker images for each participating library.
build-docker-images:
runs-on: ubuntu-latest
strategy:
matrix:
library: ["sipsorcery", "aiortc", "werift", "pion", "libdatachannel", "webrtc-rs"]
steps:
- uses: actions/checkout@v2
- name: Update submodules
if: matrix.library == 'libdatachannel'
run: git submodule update --init --recursive
- name: Build ${{ matrix.library }} and push to GitHub container registry.
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u sipsorcery --password-stdin
docker build -t ghcr.io/sipsorcery/${{ matrix.library }}-webrtc-echo -f ${{ matrix.library }}/Dockerfile .
docker push ghcr.io/sipsorcery/${{ matrix.library }}-webrtc-echo
- name: List docker images (diagnostics).
run: docker image ls
# Job Description: Performs the Peer Connection Test between each combination of the client and server for each library.
interoptests:
runs-on: ubuntu-latest
outputs:
result_sipsorcery_sipsorcery: ${{ steps.set-output.outputs.result_sipsorcery_sipsorcery }}
result_sipsorcery_aiortc: ${{ steps.set-output.outputs.result_sipsorcery_aiortc }}
result_sipsorcery_werift: ${{ steps.set-output.outputs.result_sipsorcery_werift }}
result_sipsorcery_pion: ${{ steps.set-output.outputs.result_sipsorcery_pion }}
result_sipsorcery_libdatachannel: ${{ steps.set-output.outputs.result_sipsorcery_libdatachannel }}
result_sipsorcery_webrtc_rs: ${{ steps.set-output.outputs.result_sipsorcery_webrtc_rs }}
result_aiortc_sipsorcery: ${{ steps.set-output.outputs.result_aiortc_sipsorcery }}
result_aiortc_aiortc: ${{ steps.set-output.outputs.result_aiortc_aiortc }}
result_aiortc_werift: ${{ steps.set-output.outputs.result_aiortc_werift }}
result_aiortc_pion: ${{ steps.set-output.outputs.result_aiortc_pion }}
result_aiortc_libdatachannel: ${{ steps.set-output.outputs.result_aiortc_libdatachannel }}
result_aiortc_webrtc_rs: ${{ steps.set-output.outputs.result_aiortc_webrtc_rs }}
result_werift_sipsorcery: ${{ steps.set-output.outputs.result_werift_sipsorcery }}
result_werift_aiortc: ${{ steps.set-output.outputs.result_werift_aiortc }}
result_werift_werift: ${{ steps.set-output.outputs.result_werift_werift }}
result_werift_pion: ${{ steps.set-output.outputs.result_werift_pion }}
result_werift_libdatachannel: ${{ steps.set-output.outputs.result_werift_libdatachannel }}
result_werift_webrtc_rs: ${{ steps.set-output.outputs.result_werift_webrtc_rs }}
result_pion_sipsorcery: ${{ steps.set-output.outputs.result_pion_sipsorcery }}
result_pion_aiortc: ${{ steps.set-output.outputs.result_pion_aiortc }}
result_pion_werift: ${{ steps.set-output.outputs.result_pion_werift }}
result_pion_pion: ${{ steps.set-output.outputs.result_pion_pion }}
result_pion_libdatachannel: ${{ steps.set-output.outputs.result_pion_libdatachannel }}
result_pion_webrtc_rs: ${{ steps.set-output.outputs.result_pion_webrtc_rs }}
result_libdatachannel_sipsorcery: ${{ steps.set-output.outputs.result_libdatachannel_sipsorcery }}
result_libdatachannel_aiortc: ${{ steps.set-output.outputs.result_libdatachannel_aiortc }}
result_libdatachannel_werift: ${{ steps.set-output.outputs.result_libdatachannel_werift }}
result_libdatachannel_pion: ${{ steps.set-output.outputs.result_libdatachannel_pion }}
result_libdatachannel_libdatachannel: ${{ steps.set-output.outputs.result_libdatachannel_libdatachannel }}
result_libdatachannel_webrtc_rs: ${{ steps.set-output.outputs.result_libdatachannel_webrtc_rs }}
result_gstreamer_sipsorcery: ${{ steps.set-output.outputs.result_gstreamer_sipsorcery }}
result_gstreamer_aiortc: ${{ steps.set-output.outputs.result_gstreamer_aiortc }}
result_gstreamer_werift: ${{ steps.set-output.outputs.result_gstreamer_werift }}
result_gstreamer_pion: ${{ steps.set-output.outputs.result_gstreamer_pion }}
result_gstreamer_libdatachannel: ${{ steps.set-output.outputs.result_gstreamer_libdatachannel }}
result_gstreamer_webrtc_rs: ${{ steps.set-output.outputs.result_gstreamer_webrtc_rs }}
result_libwebrtc_sipsorcery: ${{ steps.set-output.outputs.result_libwebrtc_sipsorcery }}
result_libwebrtc_aiortc: ${{ steps.set-output.outputs.result_libwebrtc_aiortc }}
result_libwebrtc_werift: ${{ steps.set-output.outputs.result_libwebrtc_werift }}
result_libwebrtc_pion: ${{ steps.set-output.outputs.result_libwebrtc_pion }}
result_libwebrtc_libdatachannel: ${{ steps.set-output.outputs.result_libwebrtc_libdatachannel }}
result_libwebrtc_webrtc_rs: ${{ steps.set-output.outputs.result_libwebrtc_webrtc_rs }}
result_kurento_sipsorcery: ${{ steps.set-output.outputs.result_kurento_sipsorcery }}
result_kurento_aiortc: ${{ steps.set-output.outputs.result_kurento_aiortc }}
result_kurento_werift: ${{ steps.set-output.outputs.result_kurento_werift }}
result_kurento_pion: ${{ steps.set-output.outputs.result_kurento_pion }}
result_kurento_libdatachannel: ${{ steps.set-output.outputs.result_kurento_libdatachannel }}
result_kurento_webrtc_rs: ${{ steps.set-output.outputs.result_kurento_webrtc_rs }}
result_janus_sipsorcery: ${{ steps.set-output.outputs.result_janus_sipsorcery }}
result_janus_aiortc: ${{ steps.set-output.outputs.result_janus_aiortc }}
result_janus_werift: ${{ steps.set-output.outputs.result_janus_werift }}
result_janus_pion: ${{ steps.set-output.outputs.result_janus_pion }}
result_janus_libdatachannel: ${{ steps.set-output.outputs.result_janus_libdatachannel }}
result_janus_webrtc_rs: ${{ steps.set-output.outputs.result_janus_webrtc_rs }}
strategy:
matrix:
server: ["sipsorcery", "aiortc", "werift", "pion", "libdatachannel", "gstreamer", "libwebrtc", "kurento", "janus", "webrtc-rs"]
client: ["sipsorcery", "aiortc", "werift", "pion", "libdatachannel", "webrtc-rs"]
needs: [build-docker-images]
services:
echo-test-server:
image: ghcr.io/sipsorcery/${{ matrix.server }}-webrtc-echo
credentials:
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
options: "--name echo-server"
steps:
- name: Peer connection test for server ${{ matrix.server }} and ${{ matrix.client }} client
id: check_connection
run: |
docker run --entrypoint "/client.sh" --network ${{ job.container.network }} ghcr.io/sipsorcery/${{ matrix.client }}-webrtc-echo http://echo-server:8080/offer
result=$?
echo "Check connection for ${{ matrix.server }} server and ${{ matrix.client }} client result $result."
echo "::set-output name=TEST_RESULT::$result"
continue-on-error: true
- name: Set output results
id: set-output
run: |
echo "Result for ${{ matrix.server }} server and ${{ matrix.client }} client, outcome ${{ steps.check_connection.outcome }}, result ${{ steps.check_connection.outputs.TEST_RESULT }}."
echo "result_${{ matrix.server }}_${{ matrix.client }}=${{ steps.check_connection.outputs.TEST_RESULT }}" >> "$GITHUB_OUTPUT"
# Job Description: Collates the results of the interop tests into a mark down table.
collate:
runs-on: ubuntu-latest
needs: [interoptests]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Create results file from interop test outputs
run: |
echo "Collating...."
echo "raw results=${{ toJSON(needs.interoptests.outputs) }}"
python --version
echo '${{ toJSON(needs.interoptests.outputs) }}' | python3 test/collate-results.py > PeerConnection_test_results.md
# Display the results file
cat PeerConnection_test_results.md
- name: Replace Peer Connection Test Results in README
run: |
# Read the new content from DPeerConnection_test_results.md
new_content="$(<PeerConnection_test_results.md)"
# Use awk to replace content between the markers
awk -v new_content="$new_content" '
BEGIN { in_section = 0 }
/## Peer Connection Test Results/ {
in_section = 1;
print;
print new_content;
next
}
/## Data Channel Echo Test Results/ {
in_section = 0;
print;
next
}
!in_section { print }
' README.md > README.tmp && mv -f README.tmp README.md
cat README.md
- name: Commit the results to the git repository
if: github.event_name != 'pull_request'
run: |
git config user.name github-actions
git config user.email [email protected]
git commit PeerConnection_test_results.md README.md -m "Automated peer connection test results."
git pull --rebase
git push