| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| name: build |
| description: "Linux: build application" |
|
|
| inputs: |
| builddir: |
| description: "Directory where build will happen" |
| required: true |
| logFile: |
| description: "Path for log file" |
| required: true |
| errorFile: |
| description: "Path to error file" |
| required: true |
| reportFile: |
| description: "Path for report file" |
| required: true |
| extraParameters: |
| description: "Extra parameters to CMake build" |
| required: false |
|
|
| runs: |
| using: "composite" |
| steps: |
| - name: Build |
| id: build |
| shell: bash -l {0} |
| run: | |
| set -o pipefail |
| (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 -l {0} |
| if: always() |
| run: | |
| if [ ${{ steps.build.outcome }} == 'success' ] |
| then |
| echo "<details><summary>:heavy_check_mark: CMake build succeeded</summary>" >> ${{ inputs.reportFile }} |
| else |
| echo "<details><summary>:fire: CMake build failed</summary>" >> ${{ inputs.reportFile }} |
| fi |
| echo "" >> ${{ inputs.reportFile }} |
| echo "Build Error Log (stderr output):" >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| echo "Build Log (only built targets reported):" >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| cat ${{ inputs.logFile }} | sed -ne "/Built target/p" >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| echo "</details>">> ${{ inputs.reportFile }} |
| echo "" >> ${{ inputs.reportFile }} |
| |