-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Extend compiler memory report to external repos (#6768)
Co-authored-by: Tom French <[email protected]> Co-authored-by: TomAFrench <[email protected]>
- Loading branch information
1 parent
a2d031f
commit 2a840ca
Showing
3 changed files
with
164 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
echo "Merging reports" | ||
|
||
REPORT_NAME=$1 | ||
NAME_PLURAL=""$REPORT_NAME"s" | ||
|
||
combined_reports="[]" | ||
|
||
# Iterate over each report and merge them | ||
for report in ./reports/*; do | ||
# The report is saved under ./$REPORT_NAME_{ matrix_report }/$REPORT_NAME_{ matrix_report }.json | ||
FILE_PATH=$(echo $(ls $report)) | ||
|
||
# Extract the $NAME_PLURAL array from each report and merge it | ||
combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")") | ||
done | ||
|
||
combined_reports=$(jq '[."'$NAME_PLURAL'"[]] + '"$combined_reports" <<< "$(cat ./$REPORT_NAME.json)") | ||
|
||
# Wrap the merged memory reports into a new object as to keep the $NAME_PLURAL key | ||
final_report="{\"$NAME_PLURAL\": $combined_reports}" | ||
|
||
echo "$final_report" > $REPORT_NAME.json | ||
|
||
cat $REPORT_NAME.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters