Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
SW-46
  • Loading branch information
loki077 committed Jan 8, 2024
1 parent 91abf66 commit cf22fbe
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/cx_build_compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,27 @@ jobs:
head_file="./artifacts/head-build-output/${{ matrix.board }}/bin/$base_filename"
echo "Comparing $base_file with $head_file"
diff_output=$(diff "$base_file" "$head_file" || true)
base_file_size=$(du -b "$base_file" | cut -f1)
head_file_size=$(du -b "$head_file" | cut -f1)
if [ -n "$diff_output" ]; then
echo "Difference found between $base_file and $head_file"
echo "$diff_output" # print the diff output to the console
echo "<testcase classname=\"${base_filename}\" name=\"CompareBuildOutputs\">" >> junit.xml
echo "<failure message=\"Difference found between $base_file and $head_file\">" >> junit.xml
echo "<failure message=\"Difference found between $base_file and $head_file. Base file size: $base_file_size bytes. Head file size: $head_file_size bytes.\">" >> junit.xml
echo "$diff_output" >> junit.xml
echo "</failure>" >> junit.xml
echo "</testcase>" >> junit.xml
else
echo "No difference found between $base_file and $head_file"
echo "<testcase classname=\"${base_filename}\" name=\"CompareBuildOutputs\">" >> junit.xml
echo "<system-out>No difference found between $base_file and $head_file. Base file size: $base_file_size bytes. Head file size: $head_file_size bytes.</system-out>" >> junit.xml
echo "</testcase>" >> junit.xml
fi
done
echo '</testsuite>' >> junit.xml
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: junit.xml

0 comments on commit cf22fbe

Please sign in to comment.