95
95
credentials :
96
96
username : ${{ github.actor }}
97
97
password : ${{ secrets.CR_PAT }}
98
- # ports:
99
- # - 8080:8080
100
98
options : " --name echo-server"
101
99
102
100
steps :
@@ -121,30 +119,50 @@ jobs:
121
119
needs : [interoptests]
122
120
steps :
123
121
- uses : actions/checkout@v2
122
+ - uses : actions/setup-python@v2
123
+ with :
124
+ python-version : " 3.x"
124
125
- name : Create results file from interop test outputs
125
126
run : |
126
127
echo "Collating...."
128
+ echo "raw results=${{ toJSON(needs.interoptests.outputs) }}"
127
129
128
- echo "raw=${{ toJSON(needs.interoptests.outputs) }}"
129
- results='${{ toJSON(needs.interoptests.outputs) }}'
130
- echo "results=${results}"
130
+ python --version
131
+
132
+ echo '${{ toJSON(needs.interoptests.outputs) }}' | python3 test/collate-results.py > PeerConnection_test_results.md
133
+
134
+ # Display the results file
135
+ cat DataChannel_Echo_test_results.md
131
136
132
- echo "| Server | Client | Test Result |" > PeerConnection_test_results.md
133
- echo "|--------|--------|-------------|" >> PeerConnection_test_results.md
137
+ - name : Replace Peer Connection Test Results in README
138
+ run : |
139
+ # Read the new content from DPeerConnection_test_results.md
140
+ new_content="$(<PeerConnection_test_results.md)"
134
141
135
- echo "${results}" | jq -r 'to_entries | .[] |
136
- "\(.key): \(.value)" |
137
- capture("result_(?<server>.+)_(?<client>.+): (?<value>.+)") |
138
- "| \(.server) | \(.client) | \(.value) |"' >> PeerConnection_test_results.md
139
-
140
- cat PeerConnection_test_results.md
142
+ # Use awk to replace content between the markers
143
+ awk -v new_content="$new_content" '
144
+ BEGIN { in_section = 0 }
145
+ /## Peer Connection Test Results/ {
146
+ in_section = 1;
147
+ print;
148
+ print new_content;
149
+ next
150
+ }
151
+ /## Data Connection Echo Test Results/ {
152
+ in_section = 0;
153
+ print;
154
+ next
155
+ }
156
+ !in_section { print }
157
+ ' README.md > README.tmp && mv -f README.tmp README.md
141
158
159
+ cat README.md
160
+
142
161
- name : Commit the results to the git repository
143
162
if : github.event_name != 'pull_request'
144
163
run : |
145
164
git config user.name github-actions
146
165
git config user.email [email protected]
147
166
git pull
148
- git add PeerConnection_test_results.md
149
- git commit PeerConnection_test_results.md -m "Automated peer connection test results."
167
+ git commit PeerConnection_test_results.md README.md -m "Automated peer connection test results."
150
168
git push
0 commit comments