-
Notifications
You must be signed in to change notification settings - Fork 17
183 lines (167 loc) · 10 KB
/
peerconnection-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
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 }}
result_webrtc-rs_sipsorcery: ${{ steps.set-output.outputs.result_janus_sipsorcery }}
result_webrtc-rs_aiortc: ${{ steps.set-output.outputs.result_janus_aiortc }}
result_webrtc-rs_werift: ${{ steps.set-output.outputs.result_janus_werift }}
result_webrtc-rs_pion: ${{ steps.set-output.outputs.result_janus_pion }}
result_webrtc-rs_libdatachannel: ${{ steps.set-output.outputs.result_janus_libdatachannel }}
result_webrtc-rs_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 PeerConnection_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