19
19
runs-on : ubuntu-latest
20
20
# See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#using-job-outputs-in-a-matrix-job
21
21
outputs :
22
- # Ridiculouse brute force but still better than upload/download unqiuely named artifacts.
23
- output_1 : ${{ steps.gen_output.outputs.output_1 }}
24
- output_2 : ${{ steps.gen_output.outputs.output_2 }}
25
- output_3 : ${{ steps.gen_output.outputs.output_3 }}
26
- output_4 : ${{ steps.gen_output.outputs.output_4 }}
27
- output_5 : ${{ steps.gen_output.outputs.output_5 }}
28
- output_6 : ${{ steps.gen_output.outputs.output_6 }}
29
- output_7 : ${{ steps.gen_output.outputs.output_7 }}
30
- output_8 : ${{ steps.gen_output.outputs.output_8 }}
31
- output_9 : ${{ steps.gen_output.outputs.output_9 }}
22
+ results : ${{ steps.record_results.outputs.results }} # Capture all results in one output
23
+
32
24
strategy :
33
25
matrix :
34
26
server : ["libdatachannel", "sipsorcery", "werift"]
55
47
continue-on-error : true
56
48
57
49
- name : Record result
50
+ id : record_results
58
51
run : |
59
52
echo "Result for ${{ matrix.server }} server and ${{ matrix.client }} client, outcome ${{ steps.check_connection.outcome }}, result ${{ steps.check_connection.outputs.TEST_RESULT }}."
60
- echo "RESULTS+=['${{ matrix.server }}','${{ matrix.client }}','${{ steps.check_connection.outputs.TEST_RESULT }}']" >> "$GITHUB_OUTPUT"
53
+ echo "${{ matrix.server }},${{ matrix.client }},${{ steps.check_connection.outputs.TEST_RESULT }}" >> results.txt
54
+
55
+ - name : Set output results
56
+ id : set_output
57
+ run : |
58
+ echo "results=$(cat results.txt | tr '\n' ' ')" >> $GITHUB_ENV # Format results for output
59
+ echo "results=${{ env.results }}" >> $GITHUB_OUTPUT # Set output to be used in the next job
61
60
62
61
# Job Description: Collates the results of the interop tests into a mark down table.
63
62
collate :
@@ -70,14 +69,15 @@ jobs:
70
69
- name : Create results file from interop test outputs
71
70
run : |
72
71
echo "Collating results from:"
73
- echo "results=${{ toJSON(needs.interop-tests.outputs) }}"
72
+ echo "results=${{ toJSON(needs.interop-tests.outputs.results ) }}"
74
73
echo "| Server | Client | Test Result |" > DataChannel_Echo_test_results.md
75
74
echo "|--------|--------|-------------|" >> DataChannel_Echo_test_results.md
76
75
77
- # Read results from the job output
78
- IFS=' ' read -r -a results_array <<< "${{ needs.interop-tests.outputs }}"
76
+ # Read results from the job output
77
+ IFS=' ' read -r -a results_array <<< "${{ needs.interop-tests.outputs.results }}"
79
78
for result in "${results_array[@]}"; do
80
- echo "| ${result[0]} | ${result[1]} | ${result[2]} |" >> DataChannel_Echo_test_results.md
79
+ IFS=',' read -r server client test_result <<< "$result"
80
+ echo "| $server | $client | $test_result |" >> DataChannel_Echo_test_results.md
81
81
done
82
82
83
83
cat DataChannel_Echo_test_results.md
0 commit comments