Skip to content

Commit

Permalink
Merge pull request #345 from masterleinad/gh_workflow_msvc
Browse files Browse the repository at this point in the history
Test with Windows and MSVC
  • Loading branch information
crtrott authored Jun 14, 2024
2 parents 421d2c2 + 646299f commit 1fea934
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CMake Windows

on:
push:
pull_request:

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all

jobs:
test_cmake-windows:
name: MSVC C++-17
runs-on: windows-2022

steps:
- uses: ilammy/msvc-dev-cmd@v1

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/mdspan-build

- name: Check Out
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/mdspan-src

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: cmake -DCMAKE_CXX_FLAGS=-EHsc $GITHUB_WORKSPACE/mdspan-src -DMDSPAN_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install -DMDSPAN_ENABLE_TESTS=ON -DMDSPAN_ENABLE_EXAMPLES=ON

- name: Build
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: cmake --build . --parallel 4 --config Debug

- name: Test
working-directory: ${{github.workspace}}/mdspan-build
shell: bash
run: ctest --output-on-failure --

- name: Install
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: cmake --build . --target install
1 change: 1 addition & 0 deletions examples/aligned_accessor/aligned_accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <iostream>
#include <memory>
#include <type_traits>
#include <string> // stoi

// mfh 2022/08/08: This is based on my comment on RAPIDS RAFT issue 725:
// https://github.com/rapidsai/raft/pull/725#discussion_r937991701
Expand Down
1 change: 1 addition & 0 deletions examples/restrict_accessor/restrict_accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <iostream>
#include <type_traits>
#include <vector>
#include <string> // stoi

// mfh 2022/08/04: This is based on my comments on reference mdspan
// implementation issue https://github.com/kokkos/mdspan/issues/169.
Expand Down
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ else()
)
endif()

# FIXME_MSVC
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
mdspan_add_test(
test_precondition_checks_can_be_disabled
SOURCE test_alternate_precondition_violation_handler.cpp
Expand All @@ -76,6 +78,7 @@ set_tests_properties(
PROPERTIES
PASS_REGULAR_EXPRESSION "Failure.*Expected.*throws an exception of type std::logic_error.*Actual.*it throws nothing"
)
endif()

if(NOT MDSPAN_ENABLE_CUDA AND NOT MDSPAN_ENABLE_HIP AND NOT MDSPAN_ENABLE_SYCL)
mdspan_add_test(test_alternate_precondition_violation_handler ENABLE_PRECONDITIONS)
Expand Down

0 comments on commit 1fea934

Please sign in to comment.