Skip to content

Commit

Permalink
style: Update test result merging in workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Dec 18, 2024
1 parent 20a86e7 commit 1f0ed09
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,25 @@ jobs:

- name: Merge test results
run: |
# Ensure we start with an empty file
echo "" > test.json
# Merge all test result files
# Start with an empty array
echo "[" > test.json
# Merge all test result files, adding commas between them
first=true
for f in test.*.json; do
cat "$f" >> test.json
if [ -f "$f" ]; then
if [ "$first" = true ]; then
first=false
else
echo "," >> test.json
fi
# Remove the last newline if it exists and append to test.json
sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/,/g' "$f" >> test.json
fi
done
# Close the array
echo "]" >> test.json
- name: Annotate tests
uses: guyarb/[email protected]
Expand Down

0 comments on commit 1f0ed09

Please sign in to comment.