Skip to content

Commit 8ef8e4d

Browse files
committed
fix bash processing of ndjson files
1 parent 9024108 commit 8ef8e4d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/NightlyBMDB_CLI.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ jobs:
205205
# Append to master summary in github workspace
206206
jq '. + [inputs]' ${{ github.workspace }}/total_exec_summary.json $(find $GITHUB_WORKSPACE/set_${{ matrix.sets }}/${base_extless_name}_output -name exec_summary.json) > temp.json
207207
mv temp.json ${{ github.workspace }}/total_exec_summary.json
208-
echo $(find $GITHUB_WORKSPACE/set_${{ matrix.sets }}/${base_extless_name}_output -name exec_summary.json) >> ${{ github.workspace }}/exec_summary.ndjson
208+
# note that the exec_summary.json file is already only a single line of json text, so simple concatenation is fine
209+
find $GITHUB_WORKSPACE/set_${{ matrix.sets }}/${base_extless_name}_output -name exec_summary.json -exec cat {} + | sort > ${{ github.workspace }}/total_exec_summary.ndjson
209210
echo "Done!"
210211
else
211212
echo "No summary found in set $GITHUB_WORKSPACE/set_${{ matrix.sets }}"
@@ -260,12 +261,18 @@ jobs:
260261
name: set_${{ matrix.sets }}.report
261262
path: ${{ github.workspace }}/errors.report
262263

263-
- name: Upload summary
264+
- name: Upload summary as json
264265
uses: actions/upload-artifact@v3
265266
with:
266267
name: set_${{ matrix.sets }}.summary
267268
path: ${{ github.workspace }}/total_exec_summary.json
268269

270+
- name: Upload summary as ndjson
271+
uses: actions/upload-artifact@v3
272+
with:
273+
name: set_${{ matrix.sets }}.summary_ndjson
274+
path: ${{ github.workspace }}/total_exec_summary.ndjson
275+
269276
- name: Upload tracer
270277
uses: actions/upload-artifact@v3
271278
with:
@@ -312,8 +319,9 @@ jobs:
312319
- name: Combine .summary artifacts into one file
313320
run: jq -s 'add | sort_by(.file_path)' $(find "$GITHUB_WORKSPACE/bmdb-results" -name 'total_exec_summary.json') > $GITHUB_WORKSPACE/summary.json
314321

315-
- name: Combine all exec_summary.ndjson files (from each of the matrix jobs) into one exec_summary.ndjson file
316-
run: echo $(find $GITHUB_WORKSPACE/bmdb-results -name 'total_exec_summary.ndjson') > $GITHUB_WORKSPACE/exec_summary.ndjson
322+
- name: Combine all .summary_ndjson artifacts into one file
323+
# note that the total_exec_summary.ndjson files are already line delimited json text, so simple concatenation is fine
324+
run: find $GITHUB_WORKSPACE/bmdb-results -name total_exec_summary.ndjson -exec cat {} + | sort > $GITHUB_WORKSPACE/exec_summary.ndjson
317325

318326
- name: Upload combined exec_summary.ndjson file
319327
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)