4141 original_sha=$(cat ./artifacts/parent-artifacts/sha.txt)
4242 original_ref=$(cat ./artifacts/parent-artifacts/ref.txt)
4343 original_conclusion=$(cat ./artifacts/parent-artifacts/conclusion.txt)
44+ original_run_id=$(cat ./artifacts/parent-artifacts/run_id.txt)
4445
4546 # Sanitize the values to avoid security issues
4647
@@ -59,17 +60,27 @@ jobs:
5960 # Conclusion: Allow alphabetical characters and underscores
6061 original_conclusion=$(echo "$original_conclusion" | tr -cd '[:alpha:]_')
6162
63+ # Run ID: Allow numeric characters
64+ original_run_id=$(echo "$original_run_id" | tr -cd '[:digit:]')
65+
6266 echo "original_event=$original_event" >> $GITHUB_ENV
6367 echo "original_action=$original_action" >> $GITHUB_ENV
6468 echo "original_sha=$original_sha" >> $GITHUB_ENV
6569 echo "original_ref=$original_ref" >> $GITHUB_ENV
6670 echo "original_conclusion=$original_conclusion" >> $GITHUB_ENV
71+ echo "original_run_id=$original_run_id" >> $GITHUB_ENV
6772
6873 echo "original_event = $original_event"
6974 echo "original_action = $original_action"
7075 echo "original_sha = $original_sha"
7176 echo "original_ref = $original_ref"
7277 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 }}"
7384
7485 - name : Publish Unit Test Results
7586 uses : EnricoMi/publish-unit-test-result-action@v2
8091 files : ./artifacts/**/*.xml
8192 action_fail : true
8293 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
83105
84106 - name : Fail if tests failed
85107 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:
138160 })).data;
139161 core.info(`${name} is ${state}`);
140162
141- - name : Create output folder
163+ - name : Generate report
142164 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' }}
143170 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
146175
147176 - name : Generate badge
148177 if : ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled
@@ -161,6 +190,6 @@ jobs:
161190 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
162191 if [[ `git status --porcelain` ]]; then
163192 git add --all
164- git commit -m "Updated runtime tests badge "
193+ git commit -m "Updated runtime tests report "
165194 git push origin HEAD:gh-pages
166195 fi
0 commit comments