Skip to content

Commit

Permalink
CI: Set up a CMake run on Cygwin
Browse files Browse the repository at this point in the history
There's talk of eliminating Autotools, so let's see if the alternative works.
  • Loading branch information
DWesl committed Mar 2, 2024
1 parent 6662212 commit 8743b33
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/run_tests_win_cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,61 @@ jobs:
timeout-minutes: 30
run: |
make check -j8 SHELL=/bin/dash
build-and-test-autotools:
runs-on: windows-latest
defaults:
run:
shell: bash -eo pipefail -o igncr "{0}"

name: Cygwin-based Autotools tests

strategy:
matrix:
build_dir: [".", "build"]

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 cmake ninja 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: (CMake) Configure in-tree build
run: >-
cmake -B ${{ matrix.build_dir }} -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
- name: Look at config.log if error
if: ${{ failure() }}
run: cat config.log

- name: Print summary
run: cat libnetcdf.settings

- name: (CMake) Build library and utilities
run: cmake --build -B ${{ matrix.build_dir }} -j8 SHELL=/bin/dash

- name: (CMake) Test DESTDIR install
run: |
cmake --build -B ${{ matrix.build_dir }} --target 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: (CMake) Build and run tests
timeout-minutes: 30
run: |
ctest -B ${{ matrix.build_dir }} -j8 SHELL=/bin/dash

0 comments on commit 8743b33

Please sign in to comment.