Run MSYS2, MinGW64-based Tests (Not Visual Studio) #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# 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 (Not Visual Studio) | |
env: | |
CPPFLAGS: "-D_BSD_SOURCE" | |
on: [pull_request,workflow_dispatch] | |
concurrency: | |
group: ${{ github.workflow}}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test-autotools: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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-zlib | |
### | |
# 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-byterange --disable-dap-remote-tests --disable-logging --enable-plugins --disable-nczarr-filters --disable-s3 | |
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 | |
if test -f ./plugins/.libs ; then dir ./plugins/.libs; fi | |
- 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 -I/mingw64/include | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
git mingw-w64-x86_64-toolchain m4 make cmake | |
mingw-w64-x86_64-hdf5 unzip mingw-w64-x86_64-libxml2 | |
mingw-w64-x86_64-zlib | |
### | |
# Configure and build | |
### | |
- name: (CMake) Configure Build | |
run: >- | |
cmake -B . -S . -DCMAKE_INSTALL_PREFIX=/usr | |
-DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_UTILITIES=ON | |
-DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=ON -DENABLE_DAP=TRUE | |
-DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DENABLE_DAP_LONG_TESTS=TRUE | |
-DENABLE_PLUGINS=ON | |
if: ${{ success() }} | |
- name: (CMake) Look at CMakeCache.txt if error | |
run: cat CMakeCache.txt | |
if: ${{ failure() }} | |
- name: (CMake) Print Summary | |
run: cat libnetcdf.settings | |
- name: (CMake) Build Library and Utilities | |
run: make -j 8 LDFLAGS="-Wl,--export-all-symbols" | |
if: ${{ success() }} | |
- name: Check for plugins | |
run: | | |
dir ./plugins | |
if test -f ./plugins/.libs ; then dir ./plugins/.libs; fi | |
- name: (CMake) 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-cmake-test-logs | |
path: | | |
*/*.log | |
*/*.trs | |
- 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 . |