add analysis and coverage to CDash reports (#4938)

* Add sanitzers and coverage workflows
* add UndefinedBehavior sanitize
This commit is contained in:
Allen Byrne 2024-10-10 13:16:36 -05:00 committed by GitHub
parent 68bffcd45e
commit 6e8c7a9597
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 473 additions and 134 deletions

419
.github/workflows/cmake-analysis.yml vendored Normal file
View File

@ -0,0 +1,419 @@
name: hdf5 dev ctest analysis runs
# Triggers the workflow on a call from another workflow
on:
workflow_call:
inputs:
snap_name:
description: 'The name in the source tarballs'
type: string
required: false
default: hdfsrc
file_base:
description: "The common base name of the source tarballs"
required: true
type: string
use_environ:
description: 'Environment to locate files'
type: string
required: true
default: snapshots
permissions:
contents: read
jobs:
coverage_test_linux_GCC:
# Linux (Ubuntu) w/ gcc + coverage
#
name: "Ubuntu GCC Coverage"
runs-on: ubuntu-latest
steps:
- name: Install CMake Dependencies (Linux_coverage)
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz curl libncurses5 build-essential
sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev
sudo apt-get install lcov -q -y
- name: Set file base name (Linux_coverage)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'release' ]]
then
SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}")
else
SOURCE_NAME_BASE=$(echo "hdfsrc")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (Linux_coverage)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-tarball
path: ${{ github.workspace }}
- name: List files for the space (Linux_coverage)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}
- name: Uncompress source (Linux_coverage)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
- name: Copy script files for the space (Linux_coverage)
run: |
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5
- name: List files for the hdf5 (Linux_coverage)
run: |
ls ${{ runner.workspace }}/hdf5
- name: Create options file (Linux_coverage)
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ runner.workspace }}/hdf5/HDF5options.cmake
write-mode: overwrite
contents: |
set (CTEST_DROP_SITE_INIT "my.cdash.org")
# Change following line to submit to your CDash dashboard to a different CDash project
set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}")
#set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5")
set (LOCAL_COVERAGE_TEST "TRUE")
set (LOCAL_USE_GCOV "TRUE")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_COVERAGE:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCODE_COVERAGE:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON")
- name: Run ctest (Linux_coverage)
run: |
cd "${{ runner.workspace }}/hdf5"
ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH_COV,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log
shell: bash
continue-on-error: true
# Save log files created by ctest script
- name: Save log (Linux_coverage)
uses: actions/upload-artifact@v4
with:
name: clang-coverage-log
path: ${{ runner.workspace }}/hdf5/hdf5.log
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
build_and_test_linux_LeakSanitizer:
# Linux (Ubuntu) w/ clang + LeakSanitizer
#
name: "Ubuntu Clang LeakSanitizer"
runs-on: ubuntu-latest
steps:
- name: Install CMake Dependencies (Linux_Leak)
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz curl libncurses5
- name: add clang to env
uses: KyleMayes/install-llvm-action@v2.0.5
id: setup-clang
with:
env: true
version: '18'
- name: Set file base name (Linux_Leak)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'release' ]]
then
SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}")
else
SOURCE_NAME_BASE=$(echo "hdfsrc")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (Linux_Leak)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-tarball
path: ${{ github.workspace }}
- name: List files for the space (Linux_Leak)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}
- name: Uncompress source (Linux_Leak)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
- name: Copy script files for the space (Linux_Leak)
run: |
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5
- name: List files for the hdf5 (Linux_Leak)
run: |
ls ${{ runner.workspace }}/hdf5
- name: Create options file (Linux_Leak)
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ runner.workspace }}/hdf5/HDF5options.cmake
write-mode: overwrite
contents: |
set (CTEST_DROP_SITE_INIT "my.cdash.org")
# Change following line to submit to your CDash dashboard to a different CDash project
set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}")
#set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (MODEL "Sanitize")
set (GROUP "Sanitize")
set (LOCAL_MEMCHECK_TEST "TRUE")
set (CTEST_MEMORYCHECK_TYPE "LeakSanitizer")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SANITIZERS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DUSE_SANITIZER:STRING=Leak")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF")
- name: Run ctest (Linux_Leak)
run: |
cd "${{ runner.workspace }}/hdf5"
ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-LEAK,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log
shell: bash
continue-on-error: true
# Save log files created by ctest script
- name: Save log (Linux_Leak)
uses: actions/upload-artifact@v4
with:
name: leak-ubuntu-log
path: ${{ runner.workspace }}/hdf5/hdf5.log
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
build_and_test_linux_AddressSanitizer:
# Linux (Ubuntu) w/ clang + AddressSanitizer
#
name: "Ubuntu Clang AddressSanitizer"
runs-on: ubuntu-latest
steps:
- name: Install CMake Dependencies (Linux_Address)
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz curl libncurses5
- name: add clang to env
uses: KyleMayes/install-llvm-action@v2.0.5
id: setup-clang
with:
env: true
version: '18'
- name: Set file base name (Linux_Address)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'release' ]]
then
SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}")
else
SOURCE_NAME_BASE=$(echo "hdfsrc")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (Linux_Address)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-tarball
path: ${{ github.workspace }}
- name: List files for the space (Linux_Address)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}
- name: Uncompress source (Linux_Address)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
- name: Copy script files for the space (Linux_Address)
run: |
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5
- name: List files for the hdf5 (Linux_Address)
run: |
ls ${{ runner.workspace }}/hdf5
- name: Create options file (Linux_Address)
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ runner.workspace }}/hdf5/HDF5options.cmake
write-mode: overwrite
contents: |
set (CTEST_DROP_SITE_INIT "my.cdash.org")
# Change following line to submit to your CDash dashboard to a different CDash project
set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}")
#set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (MODEL "Sanitize")
set (GROUP "Sanitize")
set (LOCAL_MEMCHECK_TEST "TRUE")
set (CTEST_MEMORYCHECK_TYPE "AddressSanitizer")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SANITIZERS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DUSE_SANITIZER:STRING=Address")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF")
- name: Run ctest (Linux_Address)
run: |
cd "${{ runner.workspace }}/hdf5"
ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-ADDR,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log
shell: bash
continue-on-error: true
# Save log files created by ctest script
- name: Save log (Linux_Address)
uses: actions/upload-artifact@v4
with:
name: address-ubuntu-log
path: ${{ runner.workspace }}/hdf5/hdf5.log
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
build_and_test_linux_UndefinedBehaviorSanitizer:
# Linux (Ubuntu) w/ clang + UndefinedBehaviorSanitizer
#
name: "Ubuntu Clang UndefinedBehaviorSanitizer"
runs-on: ubuntu-latest
steps:
- name: Install CMake Dependencies (Linux_UndefinedBehavior)
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz curl libncurses5
- name: add clang to env
uses: KyleMayes/install-llvm-action@v2.0.5
id: setup-clang
with:
env: true
version: '18'
- name: Set file base name (Linux_UndefinedBehavior)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'release' ]]
then
SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}")
else
SOURCE_NAME_BASE=$(echo "hdfsrc")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (Linux_UndefinedBehavior)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-tarball
path: ${{ github.workspace }}
- name: List files for the space (Linux_UndefinedBehavior)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}
- name: Uncompress source (Linux_UndefinedBehavior)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
- name: Copy script files for the space (Linux_UndefinedBehavior)
run: |
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5
cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5
- name: List files for the hdf5 (Linux_UndefinedBehavior)
run: |
ls ${{ runner.workspace }}/hdf5
- name: Create options file (Linux_UndefinedBehavior)
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ runner.workspace }}/hdf5/HDF5options.cmake
write-mode: overwrite
contents: |
set (CTEST_DROP_SITE_INIT "my.cdash.org")
# Change following line to submit to your CDash dashboard to a different CDash project
set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}")
#set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (MODEL "Sanitize")
set (GROUP "Sanitize")
set (LOCAL_MEMCHECK_TEST "TRUE")
set (CTEST_MEMORYCHECK_TYPE "UndefinedBehaviorSanitizer")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SANITIZERS:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DUSE_SANITIZER:STRING=Undefined")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF")
- name: Run ctest (Linux_UndefinedBehavior)
run: |
cd "${{ runner.workspace }}/hdf5"
ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-UNDEF,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log
shell: bash
continue-on-error: true
# Save log files created by ctest script
- name: Save log (Linux_UndefinedBehavior)
uses: actions/upload-artifact@v4
with:
name: undefined-ubuntu-log
path: ${{ runner.workspace }}/hdf5/hdf5.log
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

View File

@ -490,9 +490,7 @@ jobs:
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
BINSIGN: ${{ needs.check-secret.outputs.sign-state }}
SIGNTOOLDIR: ${{ github.workspace }}/Microsoft.Windows.SDK.BuildTools/bin/10.0.22621.0/x64
CXX: ${{ steps.setup-fortran.outputs.cc }}
run: |
cd "${{ runner.workspace }}/hdf5"
ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Intel,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log
@ -603,110 +601,6 @@ jobs:
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
####### clang builds
build_and_test_win_clang:
# Windows w/ clang + CMake
#
name: "Windows ClangCL CTest"
runs-on: windows-latest
steps:
- name: Install Dependencies (Windows_clang)
run: choco install ninja
- name: add clang to env
uses: KyleMayes/install-llvm-action@v2.0.5
id: setup-clang
with:
env: true
version: '18'
- name: Set file base name (Windows_clang)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'release' ]]
then
SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}")
else
SOURCE_NAME_BASE=$(echo "hdfsrc")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash
# Get files created by release script
- name: Get zip-tarball (Windows_clang)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: zip-tarball
path: ${{ github.workspace }}
- name: using powershell
shell: pwsh
run: Get-Location
- name: List files for the space (Windows_clang)
run: |
Get-ChildItem -Path ${{ github.workspace }}
Get-ChildItem -Path ${{ runner.workspace }}
shell: pwsh
- name: Uncompress source (Windows_clang)
working-directory: ${{ github.workspace }}
run: 7z x ${{ steps.set-file-base.outputs.FILE_BASE }}.zip
shell: bash
- name: Copy script files for the space (Windows_clang)
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake -Destination ${{ runner.workspace }}/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake -Destination ${{ runner.workspace }}/hdf5/
shell: pwsh
- name: List files for the hdf5 (Windows_clang)
run: |
Get-ChildItem -Path ${{ runner.workspace }}/hdf5
shell: pwsh
- name: Create options file (Windows_clang)
uses: "DamianReeves/write-file-action@master"
with:
path: ${{ runner.workspace }}/hdf5/HDF5options.cmake
write-mode: overwrite
contents: |
set (CTEST_DROP_SITE_INIT "my.cdash.org")
# Change following line to submit to your CDash dashboard to a different CDash project
#set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5")
set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}")
#set (CMAKE_GENERATOR_TOOLSET "ClangCL")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE")
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/clang.cmake")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF")
- name: Run ctest (Windows_clang) with clang
env:
BINSIGN: ${{ needs.check-secret.outputs.sign-state }}
SIGNTOOLDIR: ${{ github.workspace }}/Microsoft.Windows.SDK.BuildTools/bin/10.0.22621.0/x64
run: |
cd "${{ runner.workspace }}/hdf5"
ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Clang,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log
shell: pwsh
continue-on-error: true
# Save log files created by ctest script
- name: Save log (Windows_clang)
uses: actions/upload-artifact@v4
with:
name: clang-win-log
path: ${{ runner.workspace }}/hdf5/hdf5.log
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
build_and_test_linux_clang:
# Linux (Ubuntu) w/ clang + CMake
#

View File

@ -1,6 +1,7 @@
name: hdf5 dev daily build
# Triggers the workflow on a schedule or on demand
# Triggers the workflow on demand or on a call from another workflow
# NOTE: inputs must be duplicated between triggers
on:
workflow_dispatch:
inputs:
@ -9,8 +10,13 @@ on:
type: string
required: false
default: check
schedule:
- cron: "6 0 * * *"
workflow_call:
inputs:
use_ignore:
description: 'Ignore has_changes check'
type: string
required: false
default: check
permissions:
contents: read
@ -61,6 +67,14 @@ jobs:
use_environ: snapshots
if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }}
call-workflow-sanitizers:
needs: [get-old-names, call-workflow-tarball]
uses: ./.github/workflows/cmake-analysis.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
use_environ: snapshots
if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }}
call-workflow-ctest:
needs: [get-old-names, call-workflow-tarball]
uses: ./.github/workflows/cmake-ctest.yml

16
.github/workflows/daily-schedule.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: hdf5 dev daily build on schedule
# Triggers the workflow on a schedule or on demand
on:
workflow_dispatch:
schedule:
- cron: "6 0 * * *"
permissions:
contents: write # In order to allow tag creation and file deletion
jobs:
daily-build:
uses: ./.github/workflows/daily-build.yml
with:
use_ignore: check

View File

@ -600,8 +600,10 @@ option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" O
if (HDF5_ENABLE_COVERAGE)
include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake)
if(CODE_COVERAGE AND CODE_COVERAGE_ADDED)
message(VERBOSE "Add instrumentation to all targets")
add_code_coverage () # Adds instrumentation to all targets
else ()
message(VERBOSE "Use --coverage option")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")

View File

@ -67,6 +67,8 @@ if (WIN32 AND NOT MINGW)
set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1)
endif ()
endif ()
message (TRACE "MSVC=${MSVC}")
message (TRACE "HAVE_VISUAL_STUDIO=${${HDF_PREFIX}_HAVE_VISUAL_STUDIO}")
endif ()
if (WINDOWS)
@ -79,13 +81,12 @@ if (WINDOWS)
endif ()
if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
if (MSVC_VERSION GREATER_EQUAL 1900)
set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
endif ()
set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
message (TRACE "HAVE_TIMEZONE=${${HDF_PREFIX}_HAVE_TIMEZONE}")
endif ()
# ----------------------------------------------------------------------

View File

@ -81,9 +81,13 @@ option(
# Programs
find_program(LLVM_COV_PATH llvm-cov)
message(VERBOSE "program llvm-cov=${LLVM_COV_PATH}")
find_program(LLVM_PROFDATA_PATH llvm-profdata)
message(VERBOSE "program llvm-profdata=${LLVM_PROFDATA_PATH}")
find_program(LCOV_PATH lcov)
message(VERBOSE "program lcov=${LCOV_PATH}")
find_program(GENHTML_PATH genhtml)
message(VERBOSE "program genhtml=${GENHTML_PATH}")
# Hide behind the 'advanced' mode flag for GUI/ccmake
mark_as_advanced(FORCE LLVM_COV_PATH LLVM_PROFDATA_PATH LCOV_PATH GENHTML_PATH)

View File

@ -4,7 +4,11 @@
set(CMAKE_COMPILER_VENDOR "intel")
set(CMAKE_C_COMPILER icx)
set(CMAKE_CXX_COMPILER icpx)
if(WIN32)
set(CMAKE_CXX_COMPILER icx)
else()
set(CMAKE_CXX_COMPILER icpx)
endif()
set(CMAKE_Fortran_COMPILER ifx)
# the following is used if cross-compiling

View File

@ -49,13 +49,6 @@
/* (Uncomment to enable) */
/* #define ENABLE_PASSTHRU_LOGGING */
/* Hack for missing va_copy() in old Visual Studio editions
* (from H5win2_defs.h - used on VS2012 and earlier)
*/
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1800)
#define va_copy(D, S) ((D) = (S))
#endif
/************/
/* Typedefs */
/************/

View File

@ -173,14 +173,10 @@ Nflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation)
time_t
H5_make_time(struct tm *tm)
{
time_t the_time; /* The converted time */
#if defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) /* VS 2015 */
/* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global
* variable declared in time.h. That variable was deprecated and in
* VS 2015 is removed, with _get_timezone replacing it.
*/
time_t the_time; /* The converted time */
#if defined(H5_HAVE_VISUAL_STUDIO)
long timezone = 0;
#endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */
#endif
time_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@ -203,13 +199,9 @@ H5_make_time(struct tm *tm)
/* BSD-like systems */
the_time += tm->tm_gmtoff;
#elif defined(H5_HAVE_TIMEZONE)
#if defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) /* VS 2015 */
/* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global
* variable declared in time.h. That variable was deprecated and in
* VS 2015 is removed, with _get_timezone replacing it.
*/
#if defined(H5_HAVE_VISUAL_STUDIO)
_get_timezone(&timezone);
#endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */
#endif
the_time -= timezone - (tm->tm_isdst ? 3600 : 0);
#else