diff --git a/.github/workflows/arm.yml b/.github/workflows/arm.yml index 4e71c907ebd..fe07ec7a7d0 100644 --- a/.github/workflows/arm.yml +++ b/.github/workflows/arm.yml @@ -147,7 +147,7 @@ jobs: - name: Download dashboard script and testing data run: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${{ env.ExternalDataVersion }}/InsightData-${{ env.ExternalDataVersion }}.tar.gz -O cmake -E tar xfz InsightData-${{ env.ExternalDataVersion }}.tar.gz @@ -174,9 +174,14 @@ jobs: c++ --version cmake --version - ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -VV -j ${{ matrix.parallel-level }} ${{ matrix.ctest-options }} + ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -V -j ${{ matrix.parallel-level }} ${{ matrix.ctest-options }} env: CTEST_OUTPUT_ON_FAILURE: 1 + + - name: Report build warnings and errors + if: always() + run: python3 ${{ github.workspace }}/Testing/ContinuousIntegration/report_build_diagnostics.py ${{ github.workspace }}/build + - name: Save compiler cache if: ${{ !cancelled() }} uses: actions/cache/save@v5 diff --git a/Testing/ContinuousIntegration/AzurePipelinesBatch.yml b/Testing/ContinuousIntegration/AzurePipelinesBatch.yml index 87338fcd4b3..26877e77163 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesBatch.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesBatch.yml @@ -60,7 +60,7 @@ jobs: displayName: 'Install dependencies' - script: | - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -103,12 +103,16 @@ jobs: - script: | cmake --version call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - script: python $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinux.yml b/Testing/ContinuousIntegration/AzurePipelinesLinux.yml index 387f65284b1..8efbe421b62 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesLinux.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesLinux.yml @@ -66,7 +66,7 @@ jobs: - bash: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -111,12 +111,16 @@ jobs: c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() @@ -156,7 +160,7 @@ jobs: - bash: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -202,12 +206,16 @@ jobs: c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() @@ -249,7 +257,7 @@ jobs: displayName: "Install dependencies" - bash: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz cmake -E rename InsightToolkit-$(ExternalDataVersion)/.ExternalData/CID $(Build.SourcesDirectory)/.ExternalData/CID @@ -291,11 +299,16 @@ jobs: set -x c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 displayName: "Build and test" env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + + - bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml index f28d4eb5901..3e976d98800 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml @@ -68,7 +68,7 @@ jobs: - bash: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -118,12 +118,16 @@ jobs: c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 -L Python -E "(PythonExtrasTest)|(PythonFastMarching)|(PythonLazyLoadingImage)|(PythonThresholdSegmentationLevelSetWhiteMatterTest)|(PythonVerifyTTypeAPIConsistency)|(PythonWatershedSegmentation1Test)" + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 -L Python -E "(PythonExtrasTest)|(PythonFastMarching)|(PythonLazyLoadingImage)|(PythonThresholdSegmentationLevelSetWhiteMatterTest)|(PythonVerifyTTypeAPIConsistency)|(PythonWatershedSegmentation1Test)" displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml b/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml index dad7e9bfbe2..7bebb22f201 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml @@ -73,7 +73,7 @@ jobs: - bash: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -117,12 +117,16 @@ jobs: c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 3 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 3 displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml b/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml index 3a13668d08f..141ccaceb6e 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml @@ -76,7 +76,7 @@ jobs: - bash: | set -x - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -126,12 +126,16 @@ jobs: c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 3 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 3 displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/AzurePipelinesWindows.yml b/Testing/ContinuousIntegration/AzurePipelinesWindows.yml index 6928a259b2e..714f782afa9 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesWindows.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesWindows.yml @@ -61,7 +61,7 @@ jobs: displayName: 'Install dependencies' - script: | - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -104,12 +104,16 @@ jobs: - script: | cmake --version call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - script: python $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml index a471420b04b..2a1cb8664ae 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml @@ -61,7 +61,7 @@ jobs: displayName: 'Install dependencies' - script: | - git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard + git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz @@ -114,12 +114,16 @@ jobs: - script: | cmake --version call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 -L Python + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 -L Python displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 CCACHE_MAXSIZE: 2.4G + - script: python $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build + condition: succeededOrFailed() + displayName: 'Report build warnings and errors' + - script: | ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() diff --git a/Testing/ContinuousIntegration/report_build_diagnostics.py b/Testing/ContinuousIntegration/report_build_diagnostics.py new file mode 100755 index 00000000000..107bb1c1b45 --- /dev/null +++ b/Testing/ContinuousIntegration/report_build_diagnostics.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""Extract and print build warnings/errors from CTest Build.xml. + +ctest_build() writes compiler diagnostics to Build.xml for CDash but +does not print them to stdout. This script reads Build.xml from the +most recent test run and prints the content of every +and element so diagnostics appear directly in CI logs. + +Usage: + python report_build_diagnostics.py +""" + +import os +import sys +import xml.etree.ElementTree as ET + + +def main(): + if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} ", file=sys.stderr) + sys.exit(1) + + build_dir = sys.argv[1] + + # CTest writes a TAG file whose first line is the timestamp directory. + tag_file = os.path.join(build_dir, "Testing", "TAG") + if not os.path.isfile(tag_file): + print(f"No TAG file found at {tag_file} — skipping.", file=sys.stderr) + return + + with open(tag_file) as f: + tag_dir = f.readline().strip() + + build_xml = os.path.join(build_dir, "Testing", tag_dir, "Build.xml") + if not os.path.isfile(build_xml): + print(f"No Build.xml found at {build_xml} — skipping.", file=sys.stderr) + return + + tree = ET.parse(build_xml) + root = tree.getroot() + + # Find all and elements under . + warnings = [] + errors = [] + for build_elem in root.iter("Build"): + for warning in build_elem.findall("Warning"): + text = warning.findtext("Text", "").strip() + src = warning.findtext("SourceFile", "").strip() + line = warning.findtext("SourceLineNumber", "").strip() + if text: + warnings.append((src, line, text)) + for error in build_elem.findall("Error"): + text = error.findtext("Text", "").strip() + src = error.findtext("SourceFile", "").strip() + line = error.findtext("SourceLineNumber", "").strip() + if text: + errors.append((src, line, text)) + + if not warnings and not errors: + print("No build warnings or errors found.") + return + + if errors: + print(f"========== BUILD ERRORS ({len(errors)}) ==========") + for src, line, text in errors: + print(f" {text}") + print() + + if warnings: + print(f"========== BUILD WARNINGS ({len(warnings)}) ==========") + for src, line, text in warnings: + print(f" {text}") + print() + + print("====================================================") + + # Exit with non-zero status only if there are errors (warnings are + # informational). This lets CI pipelines treat the step as a + # soft-fail for warnings but hard-fail for errors if desired. + + +if __name__ == "__main__": + main()