Skip to content

Commit 31b9f75

Browse files
committed
Why do I still listen to chatgpt.
1 parent fd85b36 commit 31b9f75

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

.github/workflows/datachannel_echo-test.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020
# See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#using-job-outputs-in-a-matrix-job
2121
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+
3224
strategy:
3325
matrix:
3426
server: ["libdatachannel", "sipsorcery", "werift"]
@@ -55,9 +47,16 @@ jobs:
5547
continue-on-error: true
5648

5749
- name: Record result
50+
id: record_results
5851
run: |
5952
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
6160
6261
# Job Description: Collates the results of the interop tests into a mark down table.
6362
collate:
@@ -70,14 +69,15 @@ jobs:
7069
- name: Create results file from interop test outputs
7170
run: |
7271
echo "Collating results from:"
73-
echo "results=${{ toJSON(needs.interop-tests.outputs) }}"
72+
echo "results=${{ toJSON(needs.interop-tests.outputs.results) }}"
7473
echo "| Server | Client | Test Result |" > DataChannel_Echo_test_results.md
7574
echo "|--------|--------|-------------|" >> DataChannel_Echo_test_results.md
7675
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 }}"
7978
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
8181
done
8282
8383
cat DataChannel_Echo_test_results.md

0 commit comments

Comments
 (0)