summaryrefslogtreecommitdiffstats
path: root/.github/workflows/mingw-cmake.yml
blob: 47613189cd27c37be8fd7dd1888442dbbec56164 (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
name: hdf5 dev CMake MinGW

on:
  workflow_call:
    inputs:
      build_mode:
        description: "release vs. debug build"
        required: true
        type: string
      shared:
        description: "shared true/false"
        required: true
        type: string
      netcdf:
        description: "netcdf true/false"
        required: true
        type: string

permissions:
  contents: read

jobs:
  mingw_build_and_test:
    name: "mingw-${{ inputs.build_mode }}-NC=${{ inputs.netcdf }}"
    if: "!contains(github.event.head_commit.message, 'skip-ci')"
    runs-on: ubuntu-latest
    steps:
      - name: Get Sources
        uses: actions/checkout@v4.1.1

      - name: Install Dependencies
        shell: bash
        run: |
           sudo apt update
           sudo apt-get install -y ninja-build libtirpc-dev graphviz

      - name: Install MinGW
        uses: egor-tensin/setup-mingw@v2
        with:
          platform: x64

      - name: Install Doxygen
        uses: ssciwr/doxygen-install@v1
        with:
          version: "1.9.7"

      - name: CMake Configure
        shell: bash
        run: |
          mkdir "${{ runner.workspace }}/build"
          cd "${{ runner.workspace }}/build"
          cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \
            -G Ninja \
            --log-level=VERBOSE \
            -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
            -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/config/toolchain/mingw64.cmake \
            -DBUILD_SHARED_LIBS:BOOL=${{ inputs.shared }} \
            -DHDF4_BUILD_EXAMPLES:BOOL=ON \
            -DBUILD_JPEG_WITH_PIC:BOOL=ON \
            -DHDF4_ENABLE_NETCDF:BOOL=${{ inputs.netcdf }} \
            -DHDF4_BUILD_FORTRAN:BOOL=OFF \
            -DHDF4_BUILD_JAVA:BOOL=OFF \
            -DHDF4_BUILD_DOC:BOOL=ON \
            -DJPEG_USE_LOCALCONTENT:BOOL=OFF \
            -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \
            -DZLIB_USE_LOCALCONTENT:BOOL=OFF \
            -DHDF4_PACK_EXAMPLES:BOOL=ON \
            -DHDF4_PACKAGE_EXTLIBS:BOOL=ON \
            $GITHUB_WORKSPACE

      - name: CMake Build
        shell: bash
        run: |
          cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
        working-directory: ${{ runner.workspace }}/build

      - name: CMake Run Tests
        shell: bash
        run: |
          ctest . --parallel 2 -C ${{ inputs.build_mode }} -V
        if: false

      - name: CMake Package
        shell: bash
        run: |
          cpack -C ${{ inputs.build_mode }} -V
        working-directory: ${{ runner.workspace }}/build

      - name: List files in the space
        run: |
              ls -l ${{ runner.workspace }}/build