Skip to content

webrtc-rs 0.8.0

webrtc-rs 0.8.0 #74

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.
interop-tests:
runs-on: ubuntu-latest
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 }}
#ports:
# - 8080:8080
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: Record result
run: |
echo "Result for ${{ matrix.server }} server and ${{ matrix.client }} client, outcome ${{ steps.check_connection.outcome }}, result ${{ steps.check_connection.outputs.TEST_RESULT }}."
echo "${{ matrix.server }},${{ matrix.client }},${{ steps.check_connection.outputs.TEST_RESULT }}" >> ${{ matrix.server }}_${{ matrix.client }}_result.csv
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: results
path: |
${{ matrix.server }}_${{ matrix.client }}_result.csv
# Job Description: Collates the results of the interop tests into a mark down table.
collate:
runs-on: ubuntu-latest
needs: [interop-tests]
steps:
- uses: actions/checkout@v2
with:
ref: testresults
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Download results
uses: actions/download-artifact@v2
with:
name: results
- name: Collate result files
run: |
python --version
pip install 'weasyprint==52.4'
python test/collate-results.py PeerConnection
python test/collate-results.py PeerConnection > PeerConnection_test_results.md
cat PeerConnection_test_results.md
- name: Azure CLI script to upload results to Azure blob storage
if: github.event_name != 'pull_request'
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob upload --account-name webrtctestresults --container-name githubactions --name PeerConnection_test_results.md --file PeerConnection_test_results.md --account-key ${{ secrets.Azure_Key }} --overwrite
az storage blob upload --account-name webrtctestresults --container-name githubactions --name PeerConnection_test_results.png --file PeerConnection_test_results.png --account-key ${{ secrets.Azure_Key }} --overwrite
- 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 pull
git add PeerConnection_test_results.md PeerConnection_test_results.png
git commit PeerConnection_test_results.md PeerConnection_test_results.png -m "Automated peer connection test results."
git push