summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cmake-bintest.yml
blob: d8a4473573a877ba5db5fa25ebcdb78576aa5070 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
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"
#    if: false
    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-OSX-Clang --fresh
        shell: bash