Skip to content

Add Windows CI... #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/tests-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT

---
name: Tests on Windows

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- '.github/workflows/tests-windows.yaml'
- '**.cpp'
- '**.hpp'
- '**.hpp.in'
- 'CMakeLists.txt'
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
- 'docker/**'
- 'vendor/**'
push:
branches:
- main
paths:
- '.github/workflows/tests-windows.yaml'
- '**.cpp'
- '**.hpp'
- '**.hpp.in'
- 'CMakeLists.txt'
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
- 'docker/**'
- 'vendor/**'

concurrency:
group: ${{github.workflow}}-${{github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref}}
cancel-in-progress: true

jobs:
id_repo:
runs-on: windows-latest
steps:
- name: Identify repository
id: identify_repo
run: |
echo "in_base_repo=${{(github.event_name == 'push' && github.repository == 'CExA-project/ddc') || github.event.pull_request.head.repo.full_name == 'CExA-project/ddc'}}" >> "$GITHUB_OUTPUT"
outputs: {in_base_repo: '${{steps.identify_repo.outputs.in_base_repo}}'}

test-windows:
if: github.ref_name != 'main'
strategy:
fail-fast: false
matrix:
cxx_version: ['17', '20'] # C++23 does not work
config: ['Release']
runs-on: windows-latest
env:
Kokkos_ROOT: ${{github.workspace}}/opt/kokkos
GTest_ROOT: ${{github.workspace}}/opt/gtest
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- name: Checkout built branch
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: google/googletest
ref: v1.16.0
path: googletest
- name: Install Google test
shell: bash
run: |
cmake \
-D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
-B build \
-S googletest
cmake --build build --config ${{matrix.config}}
cmake --install build --config ${{matrix.config}} --prefix $GTest_ROOT
rm -rf build
- uses: actions/checkout@v4
with:
repository: kokkos/kokkos
ref: 4.6.00
path: kokkos
- name: Install Kokkos
shell: bash
run: |
cmake \
-D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
-D Kokkos_ENABLE_DEPRECATED_CODE_4=OFF \
-D Kokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-D Kokkos_ENABLE_SERIAL=ON \
-B build \
-S kokkos
cmake --build build --config ${{matrix.config}}
cmake --install build --config ${{matrix.config}} --prefix $Kokkos_ROOT
rm -rf build
- name: Build DDC
shell: bash
run: |
cmake \
-D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
-D DDC_GTest_DEPENDENCY_POLICY=INSTALLED \
-D DDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \
-D DDC_BUILD_KERNELS_FFT=OFF \
-D DDC_BUILD_KERNELS_SPLINES=OFF \
-D DDC_BUILD_PDI_WRAPPER=OFF \
-B build
cmake --build build --config ${{matrix.config}}
ctest --test-dir build --build-config ${{matrix.config}} --output-on-failure --timeout 10 --output-junit tests.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: ( success() || failure() ) # always run even if the previous step fails
with:
report_paths: '${{github.workspace}}/build/tests.xml'
- name: Run examples
shell: bash
run: |
./build/examples/${{matrix.config}}/game_of_life.exe
./build/examples/${{matrix.config}}/heat_equation.exe
./build/examples/${{matrix.config}}/non_uniform_heat_equation.exe
./build/examples/${{matrix.config}}/uniform_heat_equation.exe
3 changes: 2 additions & 1 deletion include/ddc/chunk_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class ChunkSpan<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy, Memo
discrete_domain_type const& domain)
{
if (!domain.empty()) {
extents_type const extents_s((front<DDims>(domain) + extents<DDims>(domain)).uid()...);
extents_type const extents_s(
(front<DDims>(domain) + ddc::extents<DDims>(domain)).uid()...);
std::array<std::size_t, sizeof...(DDims)> const strides_s {
allocation_mdspan.mapping().stride(
type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>)...};
Expand Down
1 change: 1 addition & 0 deletions include/ddc/detail/type_seq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ template <class QueryTag>
struct TypeSeqRank<SingleType<QueryTag>, TypeSeq<>>
{
static constexpr bool present = false;
static constexpr std::size_t val = std::numeric_limits<std::size_t>::max();
};

template <class QueryTag, class... TagsTail>
Expand Down