CI: improve logging for configure, build and install steps

* Line buffering for stdout and stderr to better preserve log order
 * Full log now contains both stdout and stderr to keep errors in context
This commit is contained in:
0penBrain
2023-02-12 22:28:42 +01:00
parent c83b530c6e
commit f31e5066ea
4 changed files with 7 additions and 19 deletions

View File

@@ -46,7 +46,8 @@ runs:
id: build
shell: bash
run: |
cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }} > ${{ inputs.logFile }} 2> ${{ inputs.errorFile }}
(stdbuf -oL -eL cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
- name: Write report
shell: bash
if: always()
@@ -68,8 +69,3 @@ runs:
echo '```' >> ${{ inputs.reportFile }}
echo "</details>">> ${{ inputs.reportFile }}
echo "" >> ${{ inputs.reportFile }}
# Print the Log to the console
cat ${{ inputs.errorFile }}
echo "::group::Build Log"
cat ${{ inputs.logFile }}
echo "::endgroup::"