41
41
original_sha=$(cat ./artifacts/parent-artifacts/sha.txt)
42
42
original_ref=$(cat ./artifacts/parent-artifacts/ref.txt)
43
43
original_conclusion=$(cat ./artifacts/parent-artifacts/conclusion.txt)
44
+ original_run_id=$(cat ./artifacts/parent-artifacts/run_id.txt)
44
45
45
46
# Sanitize the values to avoid security issues
46
47
@@ -59,17 +60,27 @@ jobs:
59
60
# Conclusion: Allow alphabetical characters and underscores
60
61
original_conclusion=$(echo "$original_conclusion" | tr -cd '[:alpha:]_')
61
62
63
+ # Run ID: Allow numeric characters
64
+ original_run_id=$(echo "$original_run_id" | tr -cd '[:digit:]')
65
+
62
66
echo "original_event=$original_event" >> $GITHUB_ENV
63
67
echo "original_action=$original_action" >> $GITHUB_ENV
64
68
echo "original_sha=$original_sha" >> $GITHUB_ENV
65
69
echo "original_ref=$original_ref" >> $GITHUB_ENV
66
70
echo "original_conclusion=$original_conclusion" >> $GITHUB_ENV
71
+ echo "original_run_id=$original_run_id" >> $GITHUB_ENV
67
72
68
73
echo "original_event = $original_event"
69
74
echo "original_action = $original_action"
70
75
echo "original_sha = $original_sha"
71
76
echo "original_ref = $original_ref"
72
77
echo "original_conclusion = $original_conclusion"
78
+ echo "original_run_id = $original_run_id"
79
+
80
+ - name : Print links to other runs
81
+ run : |
82
+ echo "Build, Hardware and QEMU tests: https://github.com/${{ github.repository }}/actions/runs/${{ env.original_run_id }}"
83
+ echo "Wokwi tests: https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
73
84
74
85
- name : Publish Unit Test Results
75
86
uses : EnricoMi/publish-unit-test-result-action@v2
80
91
files : ./artifacts/**/*.xml
81
92
action_fail : true
82
93
compare_to_earlier_commit : false
94
+ json_file : ./unity_results.json
95
+ json_suite_details : true
96
+
97
+ - name : Upload JSON
98
+ uses : actions/upload-artifact@v4
99
+ if : ${{ always() }}
100
+ with :
101
+ name : unity_results
102
+ overwrite : true
103
+ path : |
104
+ ./unity_results.json
83
105
84
106
- name : Fail if tests failed
85
107
if : ${{ env.original_conclusion == 'failure' || env.original_conclusion == 'timed_out' || github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' }}
@@ -138,11 +160,18 @@ jobs:
138
160
})).data;
139
161
core.info(`${name} is ${state}`);
140
162
141
- - name : Create output folder
163
+ - name : Generate report
142
164
if : ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
165
+ env :
166
+ REPORT_FILE : ./runtime-tests-results/RUNTIME_TESTS_REPORT.md
167
+ WOKWI_RUN_ID : ${{ github.event.workflow_run.id }}
168
+ BUILD_RUN_ID : ${{ env.original_run_id }}
169
+ IS_FAILING : ${{ env.original_conclusion == 'failure' || env.original_conclusion == 'timed_out' || github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' || job.status == 'failure' }}
143
170
run : |
144
- rm -rf artifacts
145
- mkdir -p runtime-tests-results
171
+ rm -rf artifacts $REPORT_FILE
172
+ mv -f ./unity_results.json ./runtime-tests-results/unity_results.json
173
+ touch $REPORT_FILE
174
+ python3 ./runtime-tests-results/table_generator.py ./runtime-tests-results/unity_results.json >> $REPORT_FILE
146
175
147
176
- name : Generate badge
148
177
if : ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
@@ -161,6 +190,6 @@ jobs:
161
190
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
162
191
if [[ `git status --porcelain` ]]; then
163
192
git add --all
164
- git commit -m "Updated runtime tests badge "
193
+ git commit -m "Updated runtime tests report "
165
194
git push origin HEAD:gh-pages
166
195
fi
0 commit comments