forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (98 loc) · 3.41 KB
/
run_tests_win_mingw.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
###
# Build hdf4, hdf5 dependencies and cache them in a combined directory.
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# for information related to github runners.
###
name: Run MSYS2, MinGW64-based Tests
env:
CPPFLAGS: "-D_BSD_SOURCE"
on: [push, pull_request, workflow_dispatch]
jobs:
build-and-test-autotools:
runs-on: windows-latest
env:
PKG_CONFIG_PATH: /mingw64/lib/pkgconfig
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain automake libtool autoconf make cmake mingw-w64-x86_64-hdf5 unzip mingw-w64-x86_64-libxml2 mingw-w64-x86_64-curl
###
# Configure and build
###
- name: (Autotools) Run autoconf
run: autoreconf -if
- name: (Autotools) Configure Build
run: ./configure --enable-hdf5 --enable-dap --disable-dap-remote-tests --disable-static --disable-logging --enable-plugins --disable-nczarr-filters --disable-nczarr-s3 --disable-nczarr-s3-tests
if: ${{ success() }}
- name: (Autotools) Look at config.log if error
run: cat config.log
if: ${{ failure() }}
- name: (Autotools) Print Summary
run: cat libnetcdf.settings
- name: (Autotools) Build Library and Utilities
run: make -j 8 LDFLAGS="-Wl,--export-all-symbols"
if: ${{ success() }}
- name: Check for plugins
run: |
dir ./plugins
dir ./plugins/.libs
- name: (Autotools) Build and Run Tests
run: make check -j 8 LDFLAGS="-Wl,--export-all-symbols"
if: ${{ success() }}
id: tests
- name: Upload test failures
if: ${{ failure() && steps.tests.conclusion == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: mingw-autotools-test-logs
path: |
*/*.log
*/*.trs
build-and-test-cmake:
runs-on: windows-latest
env:
CPPFLAGS: -I/mingw64/include/libxml2/
CMAKE_PREFIX_PATH: /mingw64
HDF5_DIR: /mingw64/lib/cmake/
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git mingw-w64-x86_64-toolchain make cmake m4
mingw-w64-x86_64-hdf5 unzip mingw-w64-x86_64-libxml2
mingw-w64-x86_64-curl mingw-w64-x86_64-dlfcn
- name: Set up build directory
run: |
mkdir build
- name: (CMake) Configure project
run: |
cd build
ls ${HDF5_DIR}
cmake .. -DENABLE_HDF5:bool=TRUE -DENABLE_DAP:bool=FALSE -DCMAKE_HOST_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION=8.1 -DENABLE_PLUGINS:bool=ON -DWIN32:bool=ON
- name: Print summary
run: >-
cd build && cat libnetcdf.settings
- name: (CMake) Build all
run: |
cd build
cmake --build . -j8
- name: (CMake) Run tests
id: cmake-run-tests
run: >-
cd build && ctest --output-on-failure -j8 .
- name: (CMake) Verbose output of CTest failures
if: failure() && steps.cmake-run-tests.conclusion == 'failure'
run: >-
cd build && ctest --output-on-failure -j8 --rerun-failed -VV .