Skip to content

Is it the dbl quotes. #104

Is it the dbl quotes.

Is it the dbl quotes. #104

name: WebRTC Data Channel Interoperability Test
on:
push:
branches:
- master
pull_request:
branches:
- master
repository_dispatch:
types: [datachannel-test-command]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Job Description: Performs the Data Channel Test between each combination of the client and server for each library.
interop-tests:
runs-on: ubuntu-latest
# See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#using-job-outputs-in-a-matrix-job
outputs:
# Ridiculouse brute force but still better than upload/download unqiuely named artifacts.
output_1: ${{ steps.gen_output.outputs.output_1 }}
output_2: ${{ steps.gen_output.outputs.output_2 }}
output_3: ${{ steps.gen_output.outputs.output_3 }}
output_4: ${{ steps.gen_output.outputs.output_4 }}
output_5: ${{ steps.gen_output.outputs.output_5 }}
output_6: ${{ steps.gen_output.outputs.output_6 }}
output_7: ${{ steps.gen_output.outputs.output_7 }}
output_8: ${{ steps.gen_output.outputs.output_8 }}
output_9: ${{ steps.gen_output.outputs.output_9 }}
strategy:
matrix:
server: ["libdatachannel", "sipsorcery", "werift"]
client: ["libdatachannel", "sipsorcery", "werift"]
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: Data Channel 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 "-s http://echo-server:8080/offer -t 1"
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 "RESULTS+=['${{ 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: [interop-tests]
steps:
- uses: actions/checkout@v2
with:
ref: testresults
- name: Create results file from interop test outputs
run: |
echo "Collating results from:"
echo "results=${{ toJSON(needs.interop-tests.outputs) }}"
echo "| Server | Client | Test Result |" > DataChannel_Echo_test_results.md
echo "|--------|--------|-------------|" >> DataChannel_Echo_test_results.md
# Read results from the job output
IFS=' ' read -r -a results_array <<< "${{ needs.interop-tests.outputs }}"
for result in "${results_array[@]}"; do
echo "| ${result[0]} | ${result[1]} | ${result[2]} |" >> DataChannel_Echo_test_results.md
done
cat DataChannel_Echo_test_results.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 pull
#git add DataChannel_Echo_test_results.md DataChannel_Echo_test_results.png
#git commit DataChannel_Echo_test_results.md DataChannel_Echo_test_results.png -m "Automated data channel echo test results."
#git add DataChannel_Echo_test_results.md
git commit DataChannel_Echo_test_results.md -m "Automated data channel echo test results."
git push