Skip to content

Commit 19f729b

Browse files
committed
ci: bring windows VS jobs to gh
1 parent 47f8241 commit 19f729b

6 files changed

Lines changed: 109 additions & 247 deletions

File tree

.github/ctest_configure.cmake

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# This script is used to configure the build and submit the results to CDash.
2+
message("CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}")
23
set(cmake_args
3-
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
4-
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
5-
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
6-
-DBUILD_TESTING_FULL=${BUILD_TESTING_FULL}
7-
-DZFP_WITH_OPENMP=${ZFP_WITH_OPENMP}
8-
-DBUILD_ZFPY=${BUILD_ZFPY}
9-
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}
10-
-DPYTHON_LIBRARY=${PYTHON_LIBRARY}
4+
${CTEST_CMAKE_EXTRA_OPTIONS}
5+
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
6+
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
7+
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
8+
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
9+
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
10+
-DBUILD_TESTING_FULL:STRING=${BUILD_TESTING_FULL}
11+
-DZFP_WITH_OPENMP:STRING=${ZFP_WITH_OPENMP}
12+
-DBUILD_ZFPY:STRING=${BUILD_ZFPY}
1113
)
1214

1315
message("cmake_args:${cmake_args}")

.github/workflows/tests.yml

Lines changed: 97 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
build:
10+
unix:
1111
runs-on: ${{matrix.os}}
1212
strategy:
1313
fail-fast: false
@@ -49,7 +49,6 @@ jobs:
4949
-DCTEST_CMAKE_GENERATOR="Unix Makefiles"
5050
-DCTEST_SITE="Github"
5151
-DCTEST_BUILD_NAME="${{matrix.os}}-${{matrix.cxx_compiler}}"
52-
-DCTEST_BUILD_FLAGS="-j"
5352
5453
steps:
5554
- uses: actions/checkout@v4
@@ -79,8 +78,10 @@ jobs:
7978
echo "LDFLAGS=\"-L$(brew --prefix llvm)/lib\"" >> $GITHUB_ENV
8079
echo "CPPFLAGS=\"-I$(brew --prefix llvm)/include\"" >> $GITHUB_ENV
8180
81+
- if: github.event_name == 'pull_request'
82+
run: echo "CDASH_ARGS=${CDASH_ARGS} -DCTEST_UPDATE_VERSION_OVERRIDE=${{ github.event.pull_request.head.sha }}" > "${GITHUB_ENV}"
83+
8284
- name: Run CMake
83-
id: cmake
8485
run: >-
8586
ctest -VV -S .github/ctest_configure.cmake ${{ env.CDASH_ARGS }}
8687
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
@@ -92,9 +93,100 @@ jobs:
9293
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
9394
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
9495
- name: Build
95-
id: build
9696
run: ctest -VV -S .github/ctest_build.cmake ${{ env.CDASH_ARGS }}
9797

9898
- name: Run Tests
99-
id: test
10099
run: ctest -VV -S .github/ctest_test.cmake ${{ env.CDASH_ARGS }}
100+
101+
windows:
102+
runs-on: ${{matrix.os}}
103+
strategy:
104+
fail-fast: false
105+
matrix:
106+
include:
107+
- generator: Visual Studio 16 2019
108+
os: windows-2019
109+
platform: x64
110+
build_type: Release
111+
112+
- generator: Visual Studio 16 2019
113+
os: windows-2019
114+
platform: x86
115+
build_type: Release
116+
117+
- generator: Visual Studio 17 2022
118+
os: windows-2022
119+
platform: x64
120+
build_type: Release
121+
122+
- generator: Visual Studio 17 2022
123+
os: windows-2022
124+
platform: x86
125+
build_type: Release
126+
127+
- generator: MinGW Makefiles
128+
os: windows-2022
129+
platform: x64
130+
build_type: Release
131+
defaults:
132+
run:
133+
shell: bash
134+
env:
135+
CDASH_ARGS: >-
136+
-DCTEST_BINARY_DIRECTORY="${{github.workspace}}\\build"
137+
-DCTEST_BUILD_NAME="${{matrix.os}}-${{matrix.platform}}-${{matrix.generator}}"
138+
-DCTEST_CMAKE_GENERATOR="${{matrix.generator}}"
139+
-DCTEST_SITE="Github"
140+
-DCTEST_SOURCE_DIRECTORY="${{github.workspace}}"
141+
steps:
142+
- uses: actions/checkout@v4
143+
with:
144+
submodules: recursive
145+
146+
- uses: TheMrMilchmann/setup-msvc-dev@v3
147+
if: startsWith(matrix.generator, 'Visual Studio')
148+
with:
149+
arch: ${{matrix.platform}}
150+
151+
- name: Install compiler
152+
if: startsWith(matrix.generator, 'MinGW')
153+
id: install_cc
154+
uses: rlalik/setup-cpp-compiler@master
155+
with:
156+
compiler: latest
157+
158+
- name: Setup Python
159+
uses: actions/setup-python@v4
160+
with:
161+
python-version: '3.8'
162+
architecture: ${{matrix.platform}}
163+
164+
- name: Install zfpy dependencies
165+
run: |
166+
python -m pip install cython
167+
python -m pip install oldest-supported-numpy
168+
python -m pip install setuptools
169+
170+
- if: github.event_name == 'pull_request'
171+
run: echo "CDASH_ARGS=${CDASH_ARGS} -DCTEST_UPDATE_VERSION_OVERRIDE=${{ github.event.pull_request.head.sha }}" > "${GITHUB_ENV}"
172+
173+
- if: startsWith(matrix.generator, 'Visual Studio')
174+
run: |
175+
echo "CDASH_ARGS=${CDASH_ARGS} -DCMAKE_CXX_FLAGS:STRING=//wd4530 -DCTEST_CMAKE_EXTRA_OPTIONS=\"-A ${{matrix.platform == 'x86' && 'Win32' || 'x64'}}\"" >> "${GITHUB_ENV}"
176+
177+
- if: startsWith(matrix.generator, 'MinGW')
178+
run: echo "CDASH_ARGS=${CDASH_ARGS} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_FLAGS=-DMS_WIN64" > "${GITHUB_ENV}"
179+
180+
- name: Configure
181+
run: >-
182+
ctest -VV -S .github/ctest_configure.cmake ${{ env.CDASH_ARGS }}
183+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
184+
-DBUILD_TESTING_FULL=ON
185+
-DZFP_WITH_OPENMP=OFF
186+
-DBUILD_ZFPY=ON
187+
188+
- name: Build
189+
run: ctest -VV -S .github/ctest_build.cmake ${{ env.CDASH_ARGS }}
190+
191+
- name: Test
192+
run: ctest -C ${{ matrix.build_type }} -VV -S .github/ctest_test.cmake ${{ env.CDASH_ARGS }}

appveyor.sh

Lines changed: 0 additions & 72 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

cmake/CTestCustom.cmake.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
55
"ld: warning: directory not found for option '-L/opt/homebrew/opt/llvm/lib'"
66
"Using deprecated NumPy API, disable it with"
77
"clang: warning: argument unused during compilation: '-fstack-clash-protection'"
8+
"warning LNK4197:.*googletest"
9+
"_ftelli64"
810
)
911
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE)
1012
list(APPEND CTEST_CUSTOM_TESTS_IGNORE)

0 commit comments

Comments
 (0)