From 595b5099ea7042cda52d22dda3dd6b4da4b683e6 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Wed, 31 Jan 2024 08:13:15 -0600 Subject: Add binary testing to CI testing (#3971) * Add binary test job * Correct names of jobs * Add build mode to binary names * Limit packaging execution * Make mac DragNDrop optional * Format if checks * fix checks for TS * Allow examples to be packaged * Correct if NOT format * Correct configure and workflow call * Separate out CMake/Autotools Parallel job * Correct binary examples path * Correct dir path for windows test * Correct paths and add extlibs * Windows binaries do not have a share folder --- .github/workflows/autotools.yml | 12 ++ .github/workflows/cmake-bintest.yml | 218 ++++++++++++++++++++++++++++++++ .github/workflows/cmake-ctest.yml | 2 +- .github/workflows/cmake.yml | 27 +++- .github/workflows/main-auto-par-spc.yml | 137 ++++++++++++++++++++ .github/workflows/main-auto-par.yml | 104 ++++----------- .github/workflows/main-auto.yml | 60 --------- .github/workflows/main-cmake-par.yml | 77 +++++++++++ .github/workflows/main-cmake.yml | 112 +++++++--------- .github/workflows/main.yml | 3 + CMakeInstallation.cmake | 5 +- 11 files changed, 542 insertions(+), 215 deletions(-) create mode 100644 .github/workflows/cmake-bintest.yml create mode 100644 .github/workflows/main-auto-par-spc.yml create mode 100644 .github/workflows/main-cmake-par.yml diff --git a/.github/workflows/autotools.yml b/.github/workflows/autotools.yml index d0cf557..4075b25 100644 --- a/.github/workflows/autotools.yml +++ b/.github/workflows/autotools.yml @@ -17,7 +17,19 @@ jobs: call-parallel-special-autotools: name: "Autotools Parallel Special Workflows" + uses: ./.github/workflows/main-auto-par-spc.yml + + call-debug-parallel-autotools: + name: "Autotools Parallel Workflows" uses: ./.github/workflows/main-auto-par.yml + with: + build_mode: "debug" + + call-release-parallel-autotools: + name: "Autotools Parallel Workflows" + uses: ./.github/workflows/main-auto-par.yml + with: + build_mode: "production" call-debug-thread-autotools: name: "Autotools Debug Thread-Safety Workflows" diff --git a/.github/workflows/cmake-bintest.yml b/.github/workflows/cmake-bintest.yml new file mode 100644 index 0000000..e076bba --- /dev/null +++ b/.github/workflows/cmake-bintest.yml @@ -0,0 +1,218 @@ +name: hdf5 examples bintest runs + +# Controls when the action will run. Triggers the workflow on a schedule +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +# A workflow run is made up of one or more jobs that can run sequentially or +# in parallel +jobs: + test_binary_win: + # Windows w/ MSVC + CMake + # + name: "Windows MSVC Binary Test" + runs-on: windows-latest + steps: + - name: Install Dependencies (Windows) + run: choco install ninja + + - name: Set up JDK 19 + uses: actions/setup-java@v3 + with: + java-version: '19' + distribution: 'temurin' + + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1.12.1 + + # Get files created by cmake-ctest script + - name: Get published binary (Windows) + uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + with: + name: zip-vs2022_cl-${{ inputs.build_mode }}-binary + path: ${{ github.workspace }}/hdf5 + + - name: Uncompress hdf5 binary (Win) + working-directory: ${{ github.workspace }}/hdf5 + run: 7z x HDF5-*-win64.zip + shell: bash + + - name: List files for the space (Win) + run: | + ls -l ${{ github.workspace }} + ls -l ${{ github.workspace }}/hdf5 + + - name: create hdf5 location (Win) + working-directory: ${{ github.workspace }}/hdf5 + run: | + New-Item -Path "${{ github.workspace }}/HDF_Group/HDF5" -ItemType Directory + Copy-Item -Path "${{ github.workspace }}/hdf5/HDF*/*" -Destination "${{ github.workspace }}/HDF_Group/HDF5" -Recurse + shell: pwsh + + - name: List files for the space (Win) + run: ls -l ${{ github.workspace }}/HDF_Group/HDF5 + + - name: set hdf5lib name + id: set-hdf5lib-name + run: | + HDF5DIR="${{ github.workspace }}/HDF_Group/HDF5" + echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT + echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT + shell: bash + + - name: List files for the binaries (Win) + run: | + ls -l ${{ github.workspace }}/HDF_Group/HDF5 + + - name: using powershell + shell: pwsh + run: Get-Location + + - name: List files for the space (Windows) + run: | + Get-ChildItem -Path ${{ github.workspace }} + Get-ChildItem -Path ${{ runner.workspace }} + shell: pwsh + + - name: Run ctest (Windows) + env: + HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }} + HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }} + run: | + cd "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/HDF5Examples" + cmake --workflow --preset=ci-StdShar-MSVC --fresh + shell: bash + + test_binary_linux: + # Linux (Ubuntu) w/ gcc + CMake + # + name: "Ubuntu gcc Binary Test" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux) + run: sudo apt-get install ninja-build doxygen graphviz + + - name: Set up JDK 19 + uses: actions/setup-java@v3 + with: + java-version: '19' + distribution: 'temurin' + + - name: Get published binary (Linux) + uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + with: + name: tgz-ubuntu-2204_gcc-${{ inputs.build_mode }}-binary + path: ${{ github.workspace }} + + - name: Uncompress hdf5 binary (Linux) + run: | + cd "${{ github.workspace }}" + tar -zxvf ${{ github.workspace }}/HDF5-*-Linux.tar.gz --strip-components 1 + + - name: set hdf5lib name + id: set-hdf5lib-name + run: | + HDF5DIR=${{ github.workspace }}/HDF_Group/HDF5/ + FILE_NAME_HDF5=$(ls ${{ github.workspace }}/HDF_Group/HDF5) + echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT + echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT + + - name: List files for the binaries (Linux) + run: | + ls -l ${{ github.workspace }}/HDF_Group/HDF5 + + - name: Set file base name (Linux) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + + - name: List files for the space (Linux) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Run ctest (Linux) + env: + HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }} + HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }} + run: | + cd "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/HDF5Examples" + cmake --workflow --preset=ci-StdShar-GNUC --fresh + shell: bash + + test_binary_mac: + # MacOS w/ Clang + CMake + # + name: "MacOS Clang Binary Test" + runs-on: macos-13 + steps: + - name: Install Dependencies (MacOS) + run: brew install ninja doxygen + + - name: Set up JDK 19 + uses: actions/setup-java@v3 + with: + java-version: '19' + distribution: 'temurin' + + - name: Get published binary (MacOS) + uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + with: + name: tgz-osx12-${{ inputs.build_mode }}-binary + path: ${{ github.workspace }} + + - name: Uncompress hdf5 binary (MacOS) + run: | + cd "${{ github.workspace }}" + tar -zxvf ${{ github.workspace }}/HDF5-*-Darwin.tar.gz --strip-components 1 + + - name: set hdf5lib name + id: set-hdf5lib-name + run: | + HDF5DIR=${{ github.workspace }}/HDF_Group/HDF5/ + FILE_NAME_HDF5=$(ls ${{ github.workspace }}/HDF_Group/HDF5) + echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT + echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT + + - name: List files for the binaries (MacOS) + run: | + ls -l ${{ github.workspace }}/HDF_Group/HDF5 + + - name: Set file base name (MacOS) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + + - name: List files for the space (MacOS) + run: | + ls ${{ github.workspace }} + ls ${{ runner.workspace }} + + # symlinks the compiler executables to a common location + - name: Setup GNU Fortran + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: gcc + version: 12 + + - name: Run ctest (MacOS) + id: run-ctest + env: + HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }} + HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }} + run: | + cd "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/HDF5Examples" + cmake --workflow --preset=ci-StdShar-Clang --fresh + shell: bash + diff --git a/.github/workflows/cmake-ctest.yml b/.github/workflows/cmake-ctest.yml index 00fb7b4..ec69415 100644 --- a/.github/workflows/cmake-ctest.yml +++ b/.github/workflows/cmake-ctest.yml @@ -177,7 +177,7 @@ jobs: # MacOS w/ Clang + CMake # name: "MacOS Clang CMake" - runs-on: macos-11 + runs-on: macos-13 steps: - name: Install Dependencies (MacOS) run: brew install ninja diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c22c753..7911be7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -19,30 +19,49 @@ jobs: name: "CMake Debug Thread-Safety Workflows" uses: ./.github/workflows/main-cmake.yml with: - thread_safety: true + thread_safety: "TS" build_mode: "Debug" call-release-thread-cmake: name: "CMake Release Thread-Safety Workflows" uses: ./.github/workflows/main-cmake.yml with: - thread_safety: true + thread_safety: "TS" build_mode: "Release" call-debug-cmake: name: "CMake Debug Workflows" uses: ./.github/workflows/main-cmake.yml with: - thread_safety: false + thread_safety: "" build_mode: "Debug" call-release-cmake: name: "CMake Release Workflows" uses: ./.github/workflows/main-cmake.yml with: - thread_safety: false + thread_safety: "" build_mode: "Release" + call-release-bintest: + name: "CMake Test Release Binaries" + needs: call-release-cmake + uses: ./.github/workflows/cmake-bintest.yml + with: + build_mode: "Release" + + call-release-par: + name: "CMake Parallel Release Workflows" + uses: ./.github/workflows/main-cmake-par.yml + with: + build_mode: "Release" + + call-debug-par: + name: "CMake Parallel Debug Workflows" + uses: ./.github/workflows/main-cmake-par.yml + with: + build_mode: "Debug" + call-release-cmake-intel: name: "CMake Intel Workflows" uses: ./.github/workflows/intel-cmake.yml diff --git a/.github/workflows/main-auto-par-spc.yml b/.github/workflows/main-auto-par-spc.yml new file mode 100644 index 0000000..f6c3316 --- /dev/null +++ b/.github/workflows/main-auto-par-spc.yml @@ -0,0 +1,137 @@ +name: hdf5 dev autotools parallel special CI + +# Controls when the action will run. Triggers the workflow on a call +on: + workflow_call: + +permissions: + contents: read + +# A workflow run is made up of one or more jobs that can run sequentially or +# in parallel. We just have one job, but the matrix items defined below will +# run in parallel. +jobs: + # + # SPECIAL AUTOTOOLS BUILDS + # + # These do not run tests and are not built into the matrix and instead + # become NEW configs as their name would clobber one of the matrix + # names (so make sure the names are UNIQUE). + # + + build_parallel_debug_werror: + name: "gcc DBG parallel -Werror (build only)" + runs-on: ubuntu-latest + steps: + # SETUP + # Only CMake need ninja-build, but we just install it unilaterally + # libssl, etc. are needed for the ros3 VFD + - name: Install Linux Dependencies + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + sudo apt install automake autoconf libtool libtool-bin + sudo apt install libaec0 libaec-dev + sudo apt install openmpi-bin openmpi-common mpi-default-dev + echo "CC=mpicc" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v4.1.1 + + # AUTOTOOLS CONFIGURE + - name: Autotools Configure + run: | + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CFLAGS=-Werror $GITHUB_WORKSPACE/configure \ + --enable-build-mode=debug \ + --enable-deprecated-symbols \ + --with-default-api-version=v114 \ + --enable-shared \ + --enable-parallel \ + --enable-subfiling-vfd \ + --disable-cxx \ + --disable-fortran \ + --disable-java \ + --disable-mirror-vfd \ + --enable-direct-vfd \ + --disable-ros3-vfd \ + shell: bash + + # BUILD + - name: Autotools Build + run: make -j3 + working-directory: ${{ runner.workspace }}/build + + # INSTALL (note that this runs even when we don't run the tests) + - name: Autotools Install + run: make install + working-directory: ${{ runner.workspace }}/build + + - name: Autotools Verify Install + run: make check-install + working-directory: ${{ runner.workspace }}/build + + build_parallel_release_werror: + name: "gcc REL parallel -Werror (build only)" + runs-on: ubuntu-latest + steps: + # SETUP + # Only CMake need ninja-build, but we just install it unilaterally + # libssl, etc. are needed for the ros3 VFD + - name: Install Linux Dependencies + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + sudo apt install automake autoconf libtool libtool-bin + sudo apt install libaec0 libaec-dev + sudo apt install openmpi-bin openmpi-common mpi-default-dev + echo "CC=mpicc" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v4.1.1 + + # AUTOTOOLS CONFIGURE + - name: Autotools Configure + run: | + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CFLAGS=-Werror $GITHUB_WORKSPACE/configure \ + --enable-build-mode=production \ + --enable-deprecated-symbols \ + --with-default-api-version=v114 \ + --enable-shared \ + --enable-parallel \ + --enable-subfiling-vfd \ + --disable-cxx \ + --disable-fortran \ + --disable-java \ + --disable-mirror-vfd \ + --enable-direct-vfd \ + --disable-ros3-vfd \ + shell: bash + + # BUILD + - name: Autotools Build + run: make -j3 + working-directory: ${{ runner.workspace }}/build + + # INSTALL (note that this runs even when we don't run the tests) + - name: Autotools Install + run: make install + working-directory: ${{ runner.workspace }}/build + + - name: Autotools Verify Install + run: make check-install + working-directory: ${{ runner.workspace }}/build + diff --git a/.github/workflows/main-auto-par.yml b/.github/workflows/main-auto-par.yml index 70cf4bd..9f1522a 100644 --- a/.github/workflows/main-auto-par.yml +++ b/.github/workflows/main-auto-par.yml @@ -1,8 +1,13 @@ -name: hdf5 dev autotools CI +name: hdf5 dev autotools parallel CI # Controls when the action will run. Triggers the workflow on a call on: workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string permissions: contents: read @@ -12,78 +17,23 @@ permissions: # run in parallel. jobs: # - # SPECIAL AUTOTOOLS BUILDS - # - # These do not run tests and are not built into the matrix and instead - # become NEW configs as their name would clobber one of the matrix - # names (so make sure the names are UNIQUE). + # The GitHub runners are inadequate for running parallel HDF5 tests, + # so we catch most issues in daily testing. What we have here is just + # a compile check to make sure nothing obvious is broken. + # A workflow that builds the library + # Parallel Linux (Ubuntu) w/ gcc + Autotools # + Autotools_build_parallel: + name: "Parallel GCC-${{ inputs.build_mode }}" + # Don't run the action if the commit message says to skip CI + if: "!contains(github.event.head_commit.message, 'skip-ci')" - build_parallel_debug_werror: - name: "gcc DBG parallel -Werror (build only)" + # The type of runner that the job will run on runs-on: ubuntu-latest - steps: - # SETUP - # Only CMake need ninja-build, but we just install it unilaterally - # libssl, etc. are needed for the ros3 VFD - - name: Install Linux Dependencies - run: | - sudo apt update - sudo apt-get install ninja-build doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - sudo apt install gcc-12 g++-12 gfortran-12 - sudo apt install automake autoconf libtool libtool-bin - sudo apt install libaec0 libaec-dev - sudo apt install openmpi-bin openmpi-common mpi-default-dev - echo "CC=mpicc" >> $GITHUB_ENV - echo "FC=mpif90" >> $GITHUB_ENV - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Get Sources - uses: actions/checkout@v4.1.1 - # AUTOTOOLS CONFIGURE - - name: Autotools Configure - run: | - sh ./autogen.sh - mkdir "${{ runner.workspace }}/build" - cd "${{ runner.workspace }}/build" - CFLAGS=-Werror $GITHUB_WORKSPACE/configure \ - --enable-build-mode=debug \ - --enable-deprecated-symbols \ - --with-default-api-version=v114 \ - --enable-shared \ - --enable-parallel \ - --enable-subfiling-vfd \ - --disable-cxx \ - --disable-fortran \ - --disable-java \ - --disable-mirror-vfd \ - --enable-direct-vfd \ - --disable-ros3-vfd \ - shell: bash - - # BUILD - - name: Autotools Build - run: make -j3 - working-directory: ${{ runner.workspace }}/build - - # INSTALL (note that this runs even when we don't run the tests) - - name: Autotools Install - run: make install - working-directory: ${{ runner.workspace }}/build - - - name: Autotools Verify Install - run: make check-install - working-directory: ${{ runner.workspace }}/build - - build_parallel_release_werror: - name: "gcc REL parallel -Werror (build only)" - runs-on: ubuntu-latest + # Steps represent a sequence of tasks that will be executed as part of the job steps: # SETUP - # Only CMake need ninja-build, but we just install it unilaterally - # libssl, etc. are needed for the ros3 VFD - name: Install Linux Dependencies run: | sudo apt update @@ -106,32 +56,22 @@ jobs: sh ./autogen.sh mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - CFLAGS=-Werror $GITHUB_WORKSPACE/configure \ - --enable-build-mode=production \ + CC=mpicc $GITHUB_WORKSPACE/configure \ + --enable-build-mode=${{ inputs.build_mode }} \ --enable-deprecated-symbols \ --with-default-api-version=v114 \ --enable-shared \ --enable-parallel \ - --enable-subfiling-vfd \ --disable-cxx \ - --disable-fortran \ + --enable-fortran \ --disable-java \ --disable-mirror-vfd \ - --enable-direct-vfd \ + --disable-direct-vfd \ --disable-ros3-vfd \ + --with-szlib=yes shell: bash # BUILD - name: Autotools Build run: make -j3 working-directory: ${{ runner.workspace }}/build - - # INSTALL (note that this runs even when we don't run the tests) - - name: Autotools Install - run: make install - working-directory: ${{ runner.workspace }}/build - - - name: Autotools Verify Install - run: make check-install - working-directory: ${{ runner.workspace }}/build - diff --git a/.github/workflows/main-auto.yml b/.github/workflows/main-auto.yml index 57b1c3d..51ddfdb 100644 --- a/.github/workflows/main-auto.yml +++ b/.github/workflows/main-auto.yml @@ -120,63 +120,3 @@ jobs: - name: Autotools Verify Install run: make check-install working-directory: ${{ runner.workspace }}/build - - # - # The GitHub runners are inadequate for running parallel HDF5 tests, - # so we catch most issues in daily testing. What we have here is just - # a compile check to make sure nothing obvious is broken. - # A workflow that builds the library - # Parallel Linux (Ubuntu) w/ gcc + Autotools - # - Autotools_build_parallel: - name: "Parallel GCC-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}d" - # Don't run the action if the commit message says to skip CI - if: "!contains(github.event.head_commit.message, 'skip-ci')" - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # SETUP - - name: Install Linux Dependencies - run: | - sudo apt update - sudo apt-get install ninja-build doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - sudo apt install gcc-12 g++-12 gfortran-12 - sudo apt install automake autoconf libtool libtool-bin - sudo apt install libaec0 libaec-dev - sudo apt install openmpi-bin openmpi-common mpi-default-dev - echo "CC=mpicc" >> $GITHUB_ENV - echo "FC=mpif90" >> $GITHUB_ENV - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Get Sources - uses: actions/checkout@v4.1.1 - - # AUTOTOOLS CONFIGURE - - name: Autotools Configure - run: | - sh ./autogen.sh - mkdir "${{ runner.workspace }}/build" - cd "${{ runner.workspace }}/build" - CC=mpicc $GITHUB_WORKSPACE/configure \ - --enable-build-mode=${{ inputs.build_mode }} \ - --enable-deprecated-symbols \ - --with-default-api-version=v114 \ - --enable-shared \ - --enable-parallel \ - --disable-cxx \ - --enable-fortran \ - --disable-java \ - --disable-mirror-vfd \ - --disable-direct-vfd \ - --disable-ros3-vfd \ - --with-szlib=yes - shell: bash - - # BUILD - - name: Autotools Build - run: make -j3 - working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/main-cmake-par.yml b/.github/workflows/main-cmake-par.yml new file mode 100644 index 0000000..faecefc --- /dev/null +++ b/.github/workflows/main-cmake-par.yml @@ -0,0 +1,77 @@ +name: hdf5 dev PAR CMake CI + +# Controls when the action will run. Triggers the workflow on a call +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +# A workflow run is made up of one or more jobs that can run sequentially or +# in parallel. We just have one job, but the matrix items defined below will +# run in parallel. +jobs: + # + # The GitHub runners are inadequate for running parallel HDF5 tests, + # so we catch most issues in daily testing. What we have here is just + # a compile check to make sure nothing obvious is broken. + # A workflow that builds the library + # Parallel Linux (Ubuntu) w/ gcc + Autotools + # + CMake_build_parallel: + name: "Parallel GCC-${{ inputs.build_mode }}" + # Don't run the action if the commit message says to skip CI + if: ${{ inputs.thread_safety != 'TS' }} + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # SETUP + - name: Install Linux Dependencies + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + sudo apt install libaec0 libaec-dev + sudo apt install openmpi-bin openmpi-common mpi-default-dev + echo "CC=mpicc" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v4.1.1 + + # CMAKE CONFIGURE + - name: CMake Configure + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_ENABLE_ALL_WARNINGS=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=ON \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DHDF5_BUILD_FORTRAN=ON \ + -DHDF5_BUILD_JAVA=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_ENABLE_MIRROR_VFD:BOOL=OFF \ + -DHDF5_ENABLE_DIRECT_VFD:BOOL=OFF \ + -DHDF5_ENABLE_ROS3_VFD:BOOL=OFF \ + -DHDF5_PACK_EXAMPLES:BOOL=ON \ + $GITHUB_WORKSPACE + shell: bash + + # BUILD + - name: CMake Build + run: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/main-cmake.yml b/.github/workflows/main-cmake.yml index 3294fb1..14e1eff 100644 --- a/.github/workflows/main-cmake.yml +++ b/.github/workflows/main-cmake.yml @@ -5,9 +5,10 @@ on: workflow_call: inputs: thread_safety: - description: "thread-safety on/off" + description: "TS or empty" required: true - type: boolean + type: string + build_mode: description: "release vs. debug build" required: true @@ -47,7 +48,7 @@ jobs: # # No Fortran, parallel, or VFDs that rely on POSIX things - name: "Windows MSVC" - os: windows-2022 + os: windows-latest toolchain: "" cpp: ON fortran: OFF @@ -82,7 +83,7 @@ jobs: mirror_vfd: ON direct_vfd: ON ros3_vfd: ON - toolchain: "config/toolchain/gcc.cmake" + toolchain: "-DCMAKE_TOOLCHAIN_FILE=config/toolchain/gcc.cmake" generator: "-G Ninja" run_tests: true @@ -105,14 +106,14 @@ jobs: mirror_vfd: ON direct_vfd: OFF ros3_vfd: OFF - toolchain: "config/toolchain/clang.cmake" + toolchain: "-DCMAKE_TOOLCHAIN_FILE=config/toolchain/clang.cmake" generator: "-G Ninja" run_tests: true # Sets the job's name from the properties - name: "${{ matrix.name }}-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}" + name: "${{ matrix.name }}-${{ inputs.build_mode }}-${{ inputs.thread_safety }}" # Don't run the action if the commit message says to skip CI if: "!contains(github.event.head_commit.message, 'skip-ci')" @@ -165,7 +166,7 @@ jobs: echo "CXX=cl.exe" >> $GITHUB_ENV echo "CC=cl.exe" >> $GITHUB_ENV if: matrix.os == 'windows-latest' - + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Get Sources uses: actions/checkout@v4.1.1 @@ -181,7 +182,7 @@ jobs: cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ ${{ matrix.generator }} \ -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} \ + ${{ matrix.toolchain }} \ -DBUILD_SHARED_LIBS=ON \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ -DHDF5_ENABLE_DOXY_WARNINGS=ON \ @@ -195,9 +196,11 @@ jobs: -DHDF5_ENABLE_MIRROR_VFD:BOOL=${{ matrix.mirror_vfd }} \ -DHDF5_ENABLE_DIRECT_VFD:BOOL=${{ matrix.direct_vfd }} \ -DHDF5_ENABLE_ROS3_VFD:BOOL=${{ matrix.ros3_vfd }} \ + -DHDF5_PACK_EXAMPLES:BOOL=ON \ + -DHDF5_PACKAGE_EXTLIBS:BOOL=ON \ $GITHUB_WORKSPACE shell: bash - if: "! (matrix.thread_safety)" + if: ${{ inputs.thread_safety != 'TS' }} - name: CMake Configure (Thread-Safe) @@ -207,8 +210,9 @@ jobs: cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ ${{ matrix.generator }} \ -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} \ + ${{ matrix.toolchain }} \ -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=${{ (matrix.os != 'windows-latest') }} \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ -DHDF5_ENABLE_THREADSAFE:BOOL=ON \ -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} \ @@ -222,9 +226,10 @@ jobs: -DHDF5_ENABLE_MIRROR_VFD:BOOL=${{ matrix.mirror_vfd }} \ -DHDF5_ENABLE_DIRECT_VFD:BOOL=${{ matrix.direct_vfd }} \ -DHDF5_ENABLE_ROS3_VFD:BOOL=${{ matrix.ros3_vfd }} \ + -DHDF5_PACK_EXAMPLES:BOOL=ON \ $GITHUB_WORKSPACE shell: bash - if: (matrix.thread_safety) + if: ${{ inputs.thread_safety == 'TS' }} # # BUILD @@ -243,75 +248,48 @@ jobs: - name: CMake Run Tests run: ctest . --parallel 2 -C ${{ inputs.build_mode }} -V working-directory: ${{ runner.workspace }}/build - if: (matrix.run_tests) && ! (matrix.thread_safety) + if: ${{ matrix.run_tests && (inputs.thread_safety != 'TS') }} # THREAD-SAFE - name: CMake Run Thread-Safe Tests run: ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -R ttsafe working-directory: ${{ runner.workspace }}/build - if: (matrix.run_tests) && (matrix.thread_safety) + if: ${{ matrix.run_tests && (inputs.thread_safety == 'TS') }} # # INSTALL (note that this runs even when we don't run the tests) # - # - # The GitHub runners are inadequate for running parallel HDF5 tests, - # so we catch most issues in daily testing. What we have here is just - # a compile check to make sure nothing obvious is broken. - # A workflow that builds the library - # Parallel Linux (Ubuntu) w/ gcc + Autotools - # - CMake_build_parallel: - name: "Parallel GCC-${{ inputs.build_mode }}-TS=${{ inputs.thread_safety }}" - # Don't run the action if the commit message says to skip CI - if: "!contains(github.event.head_commit.message, 'skip-ci')" - - # The type of runner that the job will run on - runs-on: ubuntu-latest + - name: CMake Run Package + run: cpack -C ${{ inputs.build_mode }} -V + working-directory: ${{ runner.workspace }}/build - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # SETUP - - name: Install Linux Dependencies + - name: List files in the space run: | - sudo apt update - sudo apt-get install ninja-build doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - sudo apt install gcc-12 g++-12 gfortran-12 - sudo apt install libaec0 libaec-dev - sudo apt install openmpi-bin openmpi-common mpi-default-dev - echo "CC=mpicc" >> $GITHUB_ENV - echo "FC=mpif90" >> $GITHUB_ENV + ls -l ${{ runner.workspace }}/build - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Get Sources - uses: actions/checkout@v4.1.1 + # Save files created by ctest script + - name: Save published binary (Windows) + uses: actions/upload-artifact@v4 + with: + name: zip-vs2022_cl-${{ inputs.build_mode }}-binary + path: ${{ runner.workspace }}/build/HDF5-*-win64.zip + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + if: ${{ (matrix.os == 'windows-latest') && (inputs.thread_safety != 'TS') }} - # CMAKE CONFIGURE - - name: CMake Configure - run: | - mkdir "${{ runner.workspace }}/build" - cd "${{ runner.workspace }}/build" - CC=mpicc cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ - -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} \ - -DBUILD_SHARED_LIBS=ON \ - -DHDF5_ENABLE_ALL_WARNINGS=ON \ - -DHDF5_ENABLE_PARALLEL:BOOL=ON \ - -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ - -DHDF5_BUILD_FORTRAN=ON \ - -DHDF5_BUILD_JAVA=OFF \ - -DLIBAEC_USE_LOCALCONTENT=OFF \ - -DZLIB_USE_LOCALCONTENT=OFF \ - -DHDF5_ENABLE_MIRROR_VFD:BOOL=OFF \ - -DHDF5_ENABLE_DIRECT_VFD:BOOL=OFF \ - -DHDF5_ENABLE_ROS3_VFD:BOOL=OFF \ - $GITHUB_WORKSPACE - shell: bash + - name: Save published binary (linux) + uses: actions/upload-artifact@v4 + with: + name: tgz-ubuntu-2204_gcc-${{ inputs.build_mode }}-binary + path: ${{ runner.workspace }}/build/HDF5-*-Linux.tar.gz + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + if: ${{ (matrix.os == 'ubuntu-latest') && (inputs.thread_safety != 'TS') }} - # BUILD - - name: CMake Build - run: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} - working-directory: ${{ runner.workspace }}/build + - name: Save published binary (Mac) + uses: actions/upload-artifact@v4 + with: + name: tgz-osx12-${{ inputs.build_mode }}-binary + path: ${{ runner.workspace }}/build/HDF5-*-Darwin.tar.gz + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + if: ${{ (matrix.os == 'macos-13') && (inputs.thread_safety != 'TS') }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43513c5..3f878b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,10 @@ jobs: workflow-autotools: name: "Autotools Workflows" uses: ./.github/workflows/autotools.yml + if: "!contains(github.event.head_commit.message, 'skip-ci')" workflow-cmake: name: "CMake Workflows" uses: ./.github/workflows/cmake.yml + if: "!contains(github.event.head_commit.message, 'skip-ci')" + diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index aae6d65..9229c4e 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -356,7 +356,10 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) endif () elseif (APPLE) list (APPEND CPACK_GENERATOR "STGZ") - list (APPEND CPACK_GENERATOR "DragNDrop") + option (HDF5_PACK_MACOSX_DMG "Package the HDF5 Library using DragNDrop" OFF) + if (HDF5_PACK_MACOSX_DMG) + list (APPEND CPACK_GENERATOR "DragNDrop") + endif () set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_DIR}/hdf.icns") -- cgit v0.12