-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (139 loc) · 5.39 KB
/
main.yml
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
name: amd64 clang/gcc Autotools/CMake
# Controls when the action will run. Triggers the workflow on push or pull request
on:
workflow_dispatch:
push:
branches: [ main ]
paths-ignore:
- '.github/**'
- 'release_notes/**'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
# fail-fast: false
matrix:
# name: ["Windows Latest MSVC", "Windows Previous MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC"]
name: ["Ubuntu Latest GCC", "Ubuntu Debug GCC", "Ubuntu Autotools GCC"]
include:
# - name: "Windows Latest MSVC"
# artifact: "Windows-MSVC.tar.xz"
# os: windows-2022
# build_type: "Release"
# toolchain: ""
# netcdf: ON
# java: ON
# fortran: OFF
# xdr: ON
# generator: "-G \"Visual Studio 17 2022\" -A x64"
# - name: "Windows Previous MSVC"
# artifact: "Windows-MSVC.tar.xz"
# os: windows-2019
# build_type: "Release"
# toolchain: ""
# netcdf: ON
# java: ON
# fortran: OFF
# xdr: ON
# generator: "-G \"Visual Studio 16 2019\" -A x64"
- name: "Ubuntu Latest GCC"
artifact: "Linux.tar.xz"
os: ubuntu-latest
build_type: "Release"
netcdf: ON
java: ON
xdr: ON
fortran: OFF
ts: OFF
toolchain: "config/toolchain/GCC.cmake"
generator: "-G Ninja"
# - name: "macOS Latest Clang"
# artifact: "macOS.tar.xz"
# os: macos-latest
# build_type: "Release"
# netcdf: ON
# java: ON
# fortran: OFF
# xdr: ON
# toolchain: "config/toolchain/clang.cmake"
# generator: "-G Ninja"
- name: "Ubuntu Debug GCC"
artifact: "LinuxDBG.tar.xz"
os: ubuntu-latest
build_type: "Debug"
netcdf: ON
java: ON
fortran: OFF
xdr: ON
toolchain: "config/toolchain/GCC.cmake"
generator: "-G Ninja"
- name: "Ubuntu Autotools GCC"
artifact: "LinuxA.tar.xz"
os: ubuntu-latest
build_type: "Release"
netcdf: enable
java: disable
fortran: disable
xdr: enable
toolchain: ""
generator: "autogen"
name: ${{ matrix.name }}
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'skip-ci')"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install Dependencies (Linux)
run: sudo apt-get install ninja-build
if: matrix.os == 'ubuntu-latest'
- name: Install Autotools Dependencies (Linux)
run: sudo apt-get install automake autoconf libtool libtool-bin
if: matrix.generator == 'autogen'
- name: Install Dependencies (Windows)
run: |
choco install ninja
choco install libjpeg-turbo
if: matrix.os == 'windows-latest'
- name: Install Dependencies (macOS)
run: brew install ninja
if: matrix.os == 'macos-latest'
- name: Set environment for MSVC (Windows)
if: matrix.os == 'windows-latest'
run: |
# Set these env vars so cmake picks the correct compiler
echo "CXX=cl.exe" >> $GITHUB_ENV
echo "CC=cl.exe" >> $GITHUB_ENV
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@v2
- name: Autotools Configure
if: matrix.generator == 'autogen'
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
$GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.xdr }}-hdf4-xdr --${{ matrix.netcdf }}-netcdf --${{ matrix.java }}-java --${{ matrix.fortran }}-fortran
shell: bash
- name: Configure
if: matrix.generator != 'autogen'
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF4_BUILD_TOOLS=ON -DHDF4_BUILD_UTILS=ON -DHDF4_BUILD_EXAMPLES=ON -DBUILD_JPEG_WITH_PIC:BOOL=ON -DHDF4_BUILD_XDR_LIB:BOOL=${{ matrix.xdr }} -DHDF4_ENABLE_NETCDF:BOOL=${{ matrix.netcdf }} -DHDF4_BUILD_JAVA:BOOL=${{ matrix.java }} -DHDF4_BUILD_FORTRAN:BOOL=${{ matrix.fortran }} $GITHUB_WORKSPACE
shell: bash
- name: Autotools Build
if: matrix.generator == 'autogen'
run: make
working-directory: ${{ runner.workspace }}/build
- name: Build
if: matrix.generator != 'autogen'
run: cmake --build . --config ${{ matrix.build_type }}
working-directory: ${{ runner.workspace }}/build
- name: Autotools Test
if: matrix.generator == 'autogen'
run: make check
working-directory: ${{ runner.workspace }}/build
- name: Test
if: matrix.generator != 'autogen'
run: ctest --build . -C ${{ matrix.build_type }} -V
working-directory: ${{ runner.workspace }}/build