Test more recent cmake #125
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
permissions: | |
contents: read | |
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 | |
permissions: | |
checks: write # Required by mikepenz/action-junit-report | |
steps: | |
- name: Checkout built branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
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@a83fd2b5d58d4fc702e690c1ea688d702d28d281 # v5.6.1 | |
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 |