Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add Cygwin CMake run #2930

Merged
merged 15 commits into from
Jul 1, 2024
Merged
77 changes: 74 additions & 3 deletions .github/workflows/run_tests_win_cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: windows-latest
defaults:
run:
shell: bash -eo pipefail -o igncr "{0}"
shell: C:/cygwin/bin/bash.exe -eo pipefail -o igncr "{0}"

name: Cygwin-based Autotools tests

Expand All @@ -27,18 +27,20 @@ jobs:

steps:
- name: Fix line endings
shell: pwsh
run: git config --global core.autocrlf input

- uses: actions/checkout@v4

- uses: cygwin/cygwin-install-action@v2
- uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
install-dir: 'C:\cygwin'
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
libdeflate-devel gcc-core gcc-g++ libcurl-devel libiconv-devel
libssl-devel libcrypt-devel
- name: (Autotools) Run autoconf and friends
Expand Down Expand Up @@ -80,3 +82,72 @@ jobs:
timeout-minutes: 30
run: |
make check -j8 SHELL=/bin/dash
build-and-test-cmake:
name: Cygwin-based CMake tests
runs-on: windows-latest
defaults:
run:
shell: C:/cygwin/bin/bash.exe -eo pipefail -o igncr "{0}"

steps:

- run: git config --global core.autocrlf input
shell: pwsh
- uses: actions/checkout@v4
- uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
install-dir: 'C:\cygwin'
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 gcc-g++ libcurl-devel libiconv-devel
libssl-devel libcrypt-devel cmake ninja make m4 diffutils unzip
###
# Configure and build
###

- name: (CMake) Configure Build
env:
MAKE: "/usr/bin/make"
CXX: "/usr/bin/g++"
run: |
/usr/bin/cmake \
-G"Unix Makefiles" \
-B build \
-S . \
-DCMAKE_INSTALL_PREFIX=/tmp \
-DBUILD_SHARED_LIBS=ON \
-DNETCDF_ENABLE_NETCDF_4=ON \
-DNETCDF_BUILD_UTILITIES=ON \
-DNETCDF_ENABLE_TESTS=ON \
-DNETCDF_ENABLE_HDF5=ON \
-DNETCDF_ENABLE_NCZARR=TRUE \
-DNETCDF_ENABLE_PLUGINS=ON
if: ${{ success() }}

- name: (CMake) Look at CMakeCache.txt if error
run: cat build/CMakeCache.txt
if: ${{ failure() }}

- name: (CMake) Print Summary
run: cat build/libnetcdf.settings

- name: (CMake) Build All
env:
MAKE: "/usr/bin/make"
CXX: "/usr/bin/g++"
run: cmake --build build -j$(nproc)
if: ${{ success() }}

- name: (CMake) Run Tests
run: PATH=$PWD/build:$PATH ctest --test-dir build
if: ${{ success() }}

- name: (CMake) Verbose output of CTest failures
run: >-
PATH=$PWD/build:$PATH ctest --test-dir build --output-on-failure -j$(nproc) --rerun-failed -VV
if: ${{ failure() }}
2 changes: 1 addition & 1 deletion nc_test4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ IF(USE_HDF5 AND NETCDF_ENABLE_FILTER_TESTING)
build_bin_test(test_filter_order)
build_bin_test(test_filter_repeat)
build_bin_test(tst_filter_vlen)
if(NOT MINGW)
if(NOT MINGW AND NOT CYGWIN)
ADD_SH_TEST(nc_test4 tst_filter)
endif()
ADD_SH_TEST(nc_test4 tst_specific_filters)
Expand Down
5 changes: 4 additions & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ set(CMAKE_BUILD_TYPE "")

if(WIN32)
set(PLUGINEXT "dll")
set(PLUGINPRE "__nc")
set(PLUGINPRE "__nc")
elseif(CYGWIN)
set(PLUGINEXT "dll")
set(PLUGINPRE "lib__nc")
else()
set(PLUGINPRE "lib__nc")
if(APPLE)
Expand Down
Loading