Skip to content

Commit

Permalink
Try to trim current location from parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimumCode committed Jul 6, 2024
1 parent 14ae09c commit 343ac8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ jobs:
- name: Prepare and join benchmark reports
id: prep
run: |
current_location=$(pwd)
echo "$current_location"
for report in $(find ./${{ env.RESULTS_DIR }} -type f -name "*.json")
do
file_name=$(basename "$report")
platform="${file_name%.*}"
# Trim 'it.krzeminski.snakeyaml.engine.kmp.benchmark.' to make benchmark name more readable
jq "[ .[] | .benchmark |= \"${platform}.\" + ltrimstr(\"it.krzeminski.snakeyaml.engine.kmp.benchmark.\") ]" $report > ${{ env.RESULTS_DIR }}/$platform.json
jq "[ .[] | .benchmark |= \"${platform}.\" + ltrimstr(\"it.krzeminski.snakeyaml.engine.kmp.benchmark.\") | .params |= map_values(. |= ltrimstr(\"$current_location\")) ]" $report > ${{ env.RESULTS_DIR }}/$platform.json
done
AGGREGATED_REPORT=aggregated.json
# Joined reports looks like this: [[{},{}], [{},{}]]
Expand Down

0 comments on commit 343ac8d

Please sign in to comment.