Skip to content

Commit

Permalink
Improve log outputs in CI
Browse files Browse the repository at this point in the history
* This prevents the "Output full log" step from failing with
  file-not-found if the 'success' log file is absent.

* It also shows the 'failure' log file if present, for easier
  debugging.
  • Loading branch information
mguaypaq authored and joshuacwnewton committed Aug 3, 2023
1 parent dde7a4b commit 5406c0d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/run_batch_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,19 @@ jobs:
- name: Output full log for sanity checking
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
cat process_data_sub-01.log
for logfile in process_data_sub-01.log err.process_data_sub-01.log; do
if [[ -e "${logfile}" ]]; then
echo "=== Contents of ${logfile} ==="
cat "${logfile}"
else
echo "=== No file ${logfile} ==="
fi
done
- name: Check that script executed without error
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
[ "$(compgen -G "process_data_sub-0*.log")" ] # Log files should exist
[ ! "$(compgen -G "err.process_data_sub-0*.log")" ] # Error files should NOT exist
grep -iF "warning" process_data_sub-01.log
grep -iF "error" process_data_sub-01.log
grep -iF "error" process_data_sub-01.log

0 comments on commit 5406c0d

Please sign in to comment.