forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (124 loc) · 4.59 KB
/
run_tests_win_cygwin.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
151
152
153
154
155
name: Run Cygwin-based tests
on: [pull_request,workflow_dispatch]
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true
env:
SHELLOPTS: igncr
CHERE_INVOKING: 1
CYGWIN_NOWINPATH: 1
jobs:
build-and-test-autotools:
runs-on: windows-latest
defaults:
run:
shell: bash -eo pipefail -o igncr "{0}"
name: Cygwin-based Autotools tests
strategy:
matrix:
plugin_dir_option: ["", "--without-plugin-dir"]
steps:
- name: Fix line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v3
- uses: cygwin/cygwin-install-action@v2
with:
platform: x86_64
packages: >-
git automake libtool autoconf2.5 make libhdf5-devel
libhdf4-devel zipinfo libxml2-devel perl zlib-devel
libzstd-devel libbz2-devel libaec-devel libzip-devel
libdeflate-devel gcc-core libcurl-devel libiconv-devel
libssl-devel libcrypt-devel
- name: (Autotools) Run autoconf and friends
run: |
cp -f /bin/dash /bin/sh
mkdir m4
/bin/dash /usr/bin/libtoolize --force --copy --verbose
/usr/bin/autoreconf-2.69 --force --install --verbose --debug
- name: (Autotools) Configure in-tree build
run: >-
/bin/dash ./configure --enable-hdf5 --enable-shared
--disable-static --enable-dap --disable-dap-remote-tests
--enable-plugins ${{ matrix.plugin_dir_option }}
--disable-nczarr --disable-nczarr-filters
--disable-s3 --with-s3-testing=no
- name: Look at config.log if error
if: ${{ failure() }}
run: cat config.log
- name: Print summary
run: cat libnetcdf.settings
- name: (Autotools) Build library and utilities
run: make -j8 SHELL=/bin/dash
- name: (Autotools) Test DESTDIR install
run: |
make install DESTDIR=/tmp/pretend-root SHELL=/bin/dash
if [ -d "/tmp/pretend-root/$(pwd)" ];
then
find /tmp/pretend-root/$(pwd)
if [ $(find /tmp/pretend-root/$(pwd) -type f | wc -l) -gt 0 ]; then exit 1; fi
fi
- name: (Autotools) Build and run tests
timeout-minutes: 30
run: |
make check -j8 SHELL=/bin/dash
build-and-test-cmake:
runs-on: windows-latest
defaults:
run:
shell: "C:/cygwin/bin/bash.exe -eo pipefail -o igncr {0}"
name: Cygwin-based CMake tests
strategy:
matrix:
build_dir: [".", "build"]
steps:
- name: Fix line endings
shell: pwsh
run: git config --global core.autocrlf input
- uses: actions/checkout@v3
- uses: cygwin/cygwin-install-action@v2
with:
platform: x86_64
packages: >-
git cmake ninja make m4 libhdf5-devel
libhdf4-devel zipinfo libxml2-devel perl zlib-devel
libzstd-devel libbz2-devel libaec-devel libzip-devel
libdeflate-devel gcc-core gcc-g++ libcurl-devel libiconv-devel
libssl-devel libcrypt-devel doxygen
- uses: egor-tensin/cleanup-path@v4
with:
dirs: "C:/cygwin/bin;C:/cygwin/lib/lapack"
- name: (CMake) Configure out-of-tree build
run: >-
/usr/bin/cmake -B ${{ matrix.build_dir }} -S . -DBUILD_SHARED_LIBS=ON
-DNC_FIND_SHARED_LIBS=ON -DCURL_NO_CURL_CMAKE=ON
- name: Look at CMakeCache.txt if error
if: ${{ failure() }}
run: cat ${{ matrix.build_dir }}/CMakeCache.txt
- name: (CMake) Build library and utilities
run: >-
cd ${{ matrix.build_dir }} && make -j8
- name: (CMake) Test DESTDIR install
run: |
cd ${{ matrix.build_dir }}
DESTDIR=/tmp/pretend-root /usr/bin/cmake --build . --target install
if [ -d "/tmp/pretend-root/$(dirname $(pwd))" ];
then
find /tmp/pretend-root/$(pwd)
if [ $(find /tmp/pretend-root/$(dirname $(pwd)) -type f | wc -l) -gt 0 ]; then exit 1; fi
fi
- name: (CMake) Build and run tests
timeout-minutes: 30
run: |
cd ${{ matrix.build_dir }}
ctest --output-on-failure .
- name: (CMake) Verbose output of CTest failures
if: failure()
run: >-
cd ${{ matrix.build_dir }} && /usr/bin/ctest --output-on-failure -j8 --rerun-failed -VV .
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cygwin-cmake-test-logs
path: |
${{ matrix.build_dir }}/Testing/