Skip to content

Commit

Permalink
test mingw and cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollstrecker committed Dec 5, 2024
1 parent f842b90 commit 63e8c47
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 4 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/msys-cygwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: mingw/cygwin

on: [push, pull_request]

jobs:
MSys:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sys: [mingw32, mingw64, ucrt64, clang64]
name: MSys - ${{ matrix.sys }}
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >-
make
pacboy: >-
toolchain:p
cmake:p
- name: Configure
run: |
cmake -G"Unix Makefiles" \
-S . \
-B build \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Run tests
run: ctest --output-on-failure --test-dir build -C Release

cygwin:
strategy:
fail-fast: false
runs-on: windows-latest
defaults:
run:
shell: C:\cygwin\bin\bash.exe --login -o igncr '{0}'
name: Cygwin
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup cygwin
uses: cygwin/cygwin-install-action@master
with:
packages: >-
cmake
cygwin-devel
gcc-core
gcc-g++
ninja
- name: Configure
run: |
cmake /cygdrive/d/a/zlib/zlib \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-G Ninja
- name: Build
run: cmake --build build --config Release
- name: Run tests
run: ctest --output-on-failure --test-dir build -C Release
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ if(ZLIB_INSTALL_LIBRARIES)
COMPONENT Development
RENAME libz.dll.a
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif(ZLIB_INSTALL_COMPAT_DLL)
endif(ZLIB_INSTALL_COMPAT_DLL AND MINGW)

endif(ZLIB_BUILD_STATIC)

Expand Down
9 changes: 6 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ set_tests_properties(zlib_test_build_find_package PROPERTIES
FIXTURES_SETUP fp_build)

set_tests_properties(zlib_test_test_find_package PROPERTIES
FIXTURES_REQUIRED fp_build)
FIXTURES_REQUIRED fp_build
ENVIRONMENT CTEST_OUTPUT_ON_FAILURE=1)

#
# add_subdirectory_test
Expand Down Expand Up @@ -95,7 +96,8 @@ set_tests_properties(zlib_test_build_add_subdirectory PROPERTIES
FIXTURES_SETUP as_build)

set_tests_properties(zlib_test_test_add_subdirectory PROPERTIES
FIXTURES_REQUIRED as_build)
FIXTURES_REQUIRED as_build
ENVIRONMENT CTEST_OUTPUT_ON_FAILURE=1)

#
# add_subdirectory_exclude_test
Expand Down Expand Up @@ -129,4 +131,5 @@ set_tests_properties(zlib_test_build_add_subdirectory_exclude PROPERTIES
FIXTURES_SETUP asx_build)

set_tests_properties(zlib_test_test_add_subdirectory_exclude PROPERTIES
FIXTURES_REQUIRED asx_build)
FIXTURES_REQUIRED asx_build
ENVIRONMENT CTEST_OUTPUT_ON_FAILURE=1)

0 comments on commit 63e8c47

Please sign in to comment.