Skip to content

Commit 58e5233

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

4 files changed

Lines changed: 111 additions & 53 deletions

File tree

.github/ctest_configure.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# This script is used to configure the build and submit the results to CDash.
22
set(cmake_args
3+
${CTEST_CMAKE_EXTRA_OPTIONS}
34
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
45
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
56
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
67
-DBUILD_TESTING_FULL=${BUILD_TESTING_FULL}
78
-DZFP_WITH_OPENMP=${ZFP_WITH_OPENMP}
89
-DBUILD_ZFPY=${BUILD_ZFPY}
9-
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}
10-
-DPYTHON_LIBRARY=${PYTHON_LIBRARY}
1110
)
1211

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

.github/workflows/tests.yml

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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,102 @@ 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+
win:
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: Win32
130+
build_type: Release
131+
132+
- generator: MinGW Makefiles
133+
os: windows-2022
134+
platform: x64
135+
build_type: Release
136+
defaults:
137+
run:
138+
shell: bash
139+
env:
140+
CDASH_ARGS: >-
141+
-DCTEST_BINARY_DIRECTORY="${{github.workspace}}\\build"
142+
-DCTEST_BUILD_NAME="${{matrix.os}}-${{matrix.platform}}"
143+
-DCTEST_CMAKE_EXTRA_OPTIONS="-A ${{matrix.platform == 'x86' && 'Win32' || 'x64'}}"
144+
-DCTEST_CMAKE_GENERATOR="${{matrix.generator}}"
145+
-DCTEST_SITE="Github"
146+
-DCTEST_SOURCE_DIRECTORY="${{github.workspace}}"
147+
steps:
148+
- uses: actions/checkout@v4
149+
with:
150+
submodules: recursive
151+
152+
- uses: TheMrMilchmann/setup-msvc-dev@v3
153+
if: startsWith(matrix.generator, 'Visual Studio')
154+
with:
155+
arch: ${{matrix.platform}}
156+
157+
- name: Install compiler
158+
if: startsWith(matrix.generator, 'MinGW')
159+
id: install_cc
160+
uses: rlalik/setup-cpp-compiler@master
161+
with:
162+
compiler: latest
163+
164+
- name: Setup Python
165+
uses: actions/setup-python@v4
166+
with:
167+
python-version: '3.8'
168+
architecture: ${{matrix.platform}}
169+
170+
- name: Install zfpy dependencies
171+
run: |
172+
python -m pip install cython
173+
python -m pip install oldest-supported-numpy
174+
python -m pip install setuptools
175+
176+
- if: github.event_name == 'pull_request'
177+
run: echo "CDASH_ARGS=${CDASH_ARGS} -DCTEST_UPDATE_VERSION_OVERRIDE=${{ github.event.pull_request.head.sha }}" > "${GITHUB_ENV}"
178+
179+
- if: startsWith(matrix.generator, 'MinGW')
180+
run: echo "CDASH_ARGS=${CDASH_ARGS} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++" > "${GITHUB_ENV}"
181+
182+
- name: Configure
183+
run: >-
184+
ctest -VV -S .github/ctest_configure.cmake ${{ env.CDASH_ARGS }}
185+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
186+
-DBUILD_TESTING_FULL=ON
187+
-DZFP_WITH_OPENMP=OFF
188+
-DBUILD_ZFPY=ON
189+
190+
- name: Build
191+
run: ctest -VV -S .github/ctest_build.cmake ${{ env.CDASH_ARGS }}
192+
193+
- name: Test
194+
run: ctest -C ${{ matrix.build_type }} -VV -S .github/ctest_test.cmake ${{ env.CDASH_ARGS }}

appveyor.yml

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,17 @@
11
version: 1.0.1-{build}
22

33
environment:
4-
# zfpy only build for Release builds (otherwise need debug python libs python27_d.lib)
5-
matrix:
6-
- COMPILER: msvc
7-
GENERATOR: Visual Studio 15 2017 Win64
8-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
9-
PLATFORM: x64
10-
BUILD_TYPE: Release
11-
PYTHON_VERSION: 38
12-
13-
- COMPILER: msvc
14-
GENERATOR: Visual Studio 15 2017
15-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
16-
PLATFORM: Win32
17-
BUILD_TYPE: Release
18-
PYTHON_VERSION: 38
19-
20-
- COMPILER: msvc
21-
GENERATOR: Visual Studio 14 2015 Win64
22-
PLATFORM: x64
23-
BUILD_TYPE: Release
24-
PYTHON_VERSION: 38
25-
26-
- COMPILER: msvc
27-
GENERATOR: Visual Studio 14 2015
28-
PLATFORM: Win32
29-
BUILD_TYPE: Release
30-
PYTHON_VERSION: 38
31-
32-
- COMPILER: mingw
33-
GENERATOR: MinGW Makefiles
34-
PLATFORM: Win32
35-
BUILD_TYPE: Release
36-
37-
- COMPILER: mingw-w64
38-
GENERATOR: MinGW Makefiles
39-
PLATFORM: x64
40-
BUILD_TYPE: Release
4+
# zfpy only build for Release builds (otherwise need debug python libs python27_d.lib)
5+
matrix:
6+
- COMPILER: mingw
7+
GENERATOR: MinGW Makefiles
8+
PLATFORM: Win32
9+
BUILD_TYPE: Release
10+
11+
- COMPILER: mingw-w64
12+
GENERATOR: MinGW Makefiles
13+
PLATFORM: x64
14+
BUILD_TYPE: Release
4115

4216
install:
4317
- if "%COMPILER%"=="mingw" set PATH=C:\MinGW\bin;%PATH%
@@ -54,16 +28,6 @@ install:
5428
$env:PYTHON_LIB_PATH = "$env:PYTHON_DIR\libs\python$env:PYTHON_VERSION.lib"
5529
}
5630
57-
# placing these behind a conditional for some reason prevents CMake from picking up the virtualenv
58-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" set PATH=%PYTHON_DIR%;%PYTHON_DIR%\Scripts;%PATH%
59-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" pip install virtualenv
60-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" set VIRTUALENV_NAME=pyVirtualEnv
61-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" virtualenv %VIRTUALENV_NAME%
62-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" "%VIRTUALENV_NAME%\\Scripts\\activate.bat"
63-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" pip install -r python\requirements.txt
64-
- if "%COMPILER%"=="msvc" if "%BUILD_TYPE%"=="Release" python --version
65-
66-
6731
build_script:
6832
- sh appveyor.sh
6933
# uncomment to enable interactive remote desktop mode

cmake/CTestCustom.cmake.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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"
89
)
910
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE)
1011
list(APPEND CTEST_CUSTOM_TESTS_IGNORE)

0 commit comments

Comments
 (0)