| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| name: configure |
| description: "Linux: configure CMake" |
|
|
| inputs: |
| sourcedir: |
| description: "Directory where sources are stored" |
| required: false |
| default: ./ |
| 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 configure" |
| required: false |
|
|
| runs: |
| using: "composite" |
| steps: |
| - name: Configure CMake |
| id: configure |
| shell: bash -l {0} |
| run: | |
| set -o pipefail |
| (stdbuf -oL -eL cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \ |
| 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} |
| - name: Write report |
| shell: bash -l {0} |
| if: always() |
| run: | |
| if [ ${{ steps.configure.outcome }} == 'success' ] |
| then |
| echo "<details><summary>:heavy_check_mark: CMake configure succeeded</summary>" >> ${{ inputs.reportFile }} |
| echo "" >> ${{ inputs.reportFile }} |
| echo "Configure Error Log (stderr output):" >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| else |
| echo "<details><summary>:fire: CMake configure failed</summary>" >> ${{ inputs.reportFile }} |
| fi |
| echo "" >> ${{ inputs.reportFile }} |
| echo "Configure Log (only final configuration values reported):" >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| cat ${{ inputs.logFile }} | sed -ne "/^ *==/,/^====/p" >> ${{ inputs.reportFile }} |
| echo '```' >> ${{ inputs.reportFile }} |
| echo "</details>">> ${{ inputs.reportFile }} |
| echo "" >> ${{ inputs.reportFile }} |
| |