Skip to content

Commit

Permalink
CI: Windows on GH Actions (MSVC, Clang)
Browse files Browse the repository at this point in the history
Add two new builds on GH Actions: MSVC and Clang on Windows.
  • Loading branch information
ax3l committed Dec 9, 2020
1 parent edc6e5a commit 95da488
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: windows

on: [push, pull_request]

jobs:
build_win_msvc:
name: MSVC w/o MPI
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Build & Test
run: |
md build
cd build
powershell.exe ..\share\openPMD\download_samples.ps1
cmake .. `
-DCMAKE_BUILD_TYPE=Debug
cmake --build . --config Debug --parallel 2
ctest --output-on-failure --build-config Debug
build_win_clang:
name: Clang w/o MPI
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build & Test
shell: cmd
run: |
md build
cd build
Powershell.exe -File ..\share\openPMD\download_samples.ps1
if errorlevel 1 exit 1
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
cmake .. ^
-G "Ninja" ^
-DCMAKE_C_COMPILER=clang-cl ^
-DCMAKE_CXX_COMPILER=clang-cl ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_VERBOSE_MAKEFILE=ON
if errorlevel 1 exit 1
cmake --build . --config Release --parallel 2
if errorlevel 1 exit 1
ctest --output-on-failure --build-config Release
if errorlevel 1 exit 1
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@ endif()
#
# TODO: LEGACY! Use CMake TOOLCHAINS instead!
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# On Windows, Clang -Wall aliases -Weverything; default is /W3
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT WIN32)
# list(APPEND CMAKE_CXX_FLAGS "-fsanitize=address") # address, memory, undefined
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
Expand Down

0 comments on commit 95da488

Please sign in to comment.