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

Add Cygwin GitHub Action. #4112

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ jobs:
with:
build_mode: "production"

call-release-auto-cygwin:
name: "Autotools Cygwin Workflows"
uses: ./.github/workflows/cygwin-auto.yml

call-release-auto-aocc:
name: "Autotools aocc Workflows"
uses: ./.github/workflows/aocc-ompi-auto.yml

with:
build_mode: "production"
5 changes: 5 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ jobs:
with:
build_mode: "Release"

call-release-cmake-cygwin:
name: "CMake Cygwin Workflows"
uses: ./.github/workflows/cygwin-cmake.yml

call-release-cmake-aocc:
name: "CMake nvhpc Workflows"
uses: ./.github/workflows/aocc-ompi-cmake.yml

with:
build_mode: "Release"
59 changes: 59 additions & 0 deletions .github/workflows/cygwin-auto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: hdf5 dev autotools Cygwin

on:
workflow_call:
inputs:
build_mode:
description: "release vs. debug build"
required: true
type: string

permissions:
contents: read

jobs:
cygwin_build_and_test:
name: "Cygwin ${{ inputs.build_mode }}"
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf input

- uses: actions/checkout@v4

- name: Install Cygwin
uses: cygwin/cygwin-install-action@master
with:
packages: automake make gcc-fortran libjpeg-devel libtool zlib-devel

- name: Autotools Configure
run: |
export PATH=/usr/bin:$PATH
./autogen.sh
./configure --enable-build-mode=${{ inputs.build_mode }}
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

- name: Autotools Build
run: |
export PATH=/usr/bin:$PATH
make
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

- name: Autotools Run Tests
run: |
export PATH=/usr/bin:$PATH
make check
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

- name: Autotools Install
run: |
export PATH=/usr/bin:$PATH
make install
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

- name: Autotools Uninstall
run: |
export PATH=/usr/bin:$PATH
make uninstall
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
50 changes: 50 additions & 0 deletions .github/workflows/cygwin-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: hdf5 dev CMake Cygwin

on:
workflow_call:
inputs:
build_mode:
description: "release vs. debug build"
required: true
type: string

jobs:
cygwin_build_and_test:
name: "Cygwin ${{ inputs.build_mode }}"
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf input

- uses: actions/checkout@v4

- name: Install Cygwin
uses: cygwin/cygwin-install-action@master
with:
packages: cmake gcc-fortran make ninja perl zlib-devel

- name: Configure
run: |
export PATH=/usr/bin:$PATH
mkdir build
cd build
cmake -G Ninja \
Comment on lines +30 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mkdir build
cd build
cmake -G Ninja \
cmake -S . -B build -G Ninja \

-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-D BUILD_SHARED_LIBS:BOOL=OFF \
..
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

- name: Build
run: |
export PATH=/usr/bin:$PATH
cd build
ctest -T Build
Comment on lines +41 to +42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cd build
ctest -T Build
cmake --build build -- -j8

shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

- name: Test
run: |
export PATH=/usr/bin:$PATH
cd build
ctest -T Test
Comment on lines +48 to +49
Copy link
Contributor

@tbeu tbeu Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cd build
ctest -T Test
ctest --test-dir build -T Test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbeu , thanks for taking the time to review my pull request! I also wanted to express my sincere gratitude for your work on maintaining the matio project. It's a valuable resource for the community. I'm happy to see that Cygwin is now a part of matio CI.

Copy link
Contributor

@tbeu tbeu Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it's give and take. ❤️

(Cygwin via autotools was already tested in matio via Appveyor.)

shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
4 changes: 4 additions & 0 deletions config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ endmacro ()
# ----------------------------------------------------------------------
set (WINDOWS)

if (CYGWIN)
set (HDF5_CMAKE_C_FLAGS ${HDF5_CMAKE_C_FLAGS} -D_GNU_SOURCE)
endif()

if (MINGW)
set (${HDF_PREFIX}_HAVE_MINGW 1)
set (WINDOWS 1) # MinGW tries to imitate Windows
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,10 @@ case "$host_cpu-$host_vendor-$host_os" in
AC_DEFINE([HAVE_MINGW], [1], [Define if using MinGW])
H5_CPPFLAGS="-D_GNU_SOURCE -D__USE_MINGW_ANSI_STDIO $H5_CPPFLAGS"
;;
*cygwin*)
AC_DEFINE([HAVE_CYGWIN], [1], [Define if using Cygwin])
H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS"
;;
esac

## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible
Expand Down