netcdf-c/.github/workflows/run_tests_win_cygwin.yml

129 lines
3.9 KiB
YAML

name: Run Cygwin-based tests
on: [push, pull_request, workflow_dispatch]
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
steps:
- name: Fix line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v2
- 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
- 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 --disable-nczarr-filters
--disable-nczarr-s3 --disable-nczarr-s3-tests --disable-nczarr
- 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: bash -eo pipefail -o igncr "{0}"
name: Cygwin-based CMake tests
steps:
- name: Fix line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v2
- uses: cygwin/cygwin-install-action@v2
with:
platform: x86_64
packages: >-
git make cmake ninja m4 libhdf5-devel libhdf4-devel
libjpeg-devel zipinfo libxml2-devel perl zlib-devel
libzstd-devel libbz2-devel libaec-devel libzip-devel
libdeflate-devel gcc-core gcc-g++ libcurl-devel doxygen
libiconv-devel
- uses: egor-tensin/cleanup-path@v1
with:
dirs: "C:\\cygwin\\bin;C:\\cygwin\\lib\\lapack"
- name: (CMake) Configure project
run: |
mkdir build
cd build
/usr/bin/cmake .. -DBUILD_SHARED_LIBS=ON -DENABLE_DAP=ON -DENABLE_DOXYGEN=ON -DENABLE_EXAMPLES=ON -DENABLE_EXAMPLE_TESTS=ON -DENABLE_EXTRA_TESTS=OFF -DENABLE_FILTER_TESTING=ON -DENABLE_HDF4=ON DENABLE_HDF5=Yes -DENABLE_NCZARR=Yes -DENABLE_PLUGINS=ON -DENABLE_TESTS=ON -DENABLE_UNIT_TESTS=ON
- name: Print summary
run: >-
cd build && cat libnetcdf.settings
- name: (CMake) Build all
run: >-
cd build && /usr/bin/cmake --build . --verbose -j8
- name: (CMake) Test
id: cmake-tests
run: >-
cd build && /usr/bin/ctest -j8 .
- name: (CMake) Verbose output of CTest failures
if: failure() && steps.cmake-tests.conclusion == 'failure'
run: >-
cd build && /usr/bin/ctest --output-on-failure -j8 --rerun-failed -VV .
- uses: actions/upload-artifact@v3
if: failure() && steps.cmake-tests.conclusion == 'failure'
with:
name: cygwin-cmake-test-logs
path: |
build/Testing/