Skip to content

Commit 28691bb

Browse files
committed
Replace results in readme markdown.
1 parent 708c7f0 commit 28691bb

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.github/workflows/datachannel_echo-test.yml

+23-2
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,33 @@ jobs:
8282
# Display the results file
8383
cat DataChannel_Echo_test_results.md
8484
85+
- name: Replace Data Channel Echo Test Results in README
86+
run: |
87+
# Read the new content from DataChannel_Echo_test_results.md
88+
new_content="$(<DataChannel_Echo_test_results.md)"
89+
90+
# Use awk to replace content between the markers
91+
awk -v new_content="$new_content" '
92+
BEGIN { in_section = 0 }
93+
/## Data Channel Echo Test Results/ {
94+
in_section = 1;
95+
print;
96+
print new_content;
97+
next
98+
}
99+
/## Get Started/ {
100+
in_section = 0;
101+
print;
102+
next
103+
}
104+
!in_section { print }
105+
' README.md > README.tmp && mv -f README.tmp README.md
106+
85107
- name: Commit the results to the git repository
86108
if: github.event_name != 'pull_request'
87109
run: |
88110
git config user.name github-actions
89111
git config user.email [email protected]
90112
git pull
91-
git add DataChannel_Echo_test_results.md
92-
git commit DataChannel_Echo_test_results.md -m "Automated data channel echo test results."
113+
git commit DataChannel_Echo_test_results.md README.md -m "Automated data channel echo test results."
93114
git push

test/collate-results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
print('## Test Results')
6868
print('Test run at %s\n' % datetime.now())
6969

70-
html += "<h3>Test Results</h3>"
7170
html += "<p>Test run at %s.</p>" % datetime.now()
7271

7372
# Print Table header row.
@@ -88,6 +87,7 @@
8887
html += "<td></td>"
8988
print('|')
9089
html += "</tr>"
90+
html += "<br/>"
9191

9292
html += """ </body>
9393
</html>"""

0 commit comments

Comments
 (0)