|
| 1 | +# Copyright (C) The DDC development team, see COPYRIGHT.md file |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
| 5 | +--- |
| 6 | +name: Tests on Windows |
| 7 | + |
| 8 | +# yamllint disable-line rule:truthy |
| 9 | +on: |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - '.github/workflows/tests-windows.yaml' |
| 13 | + - '**.cpp' |
| 14 | + - '**.hpp' |
| 15 | + - '**.hpp.in' |
| 16 | + - 'CMakeLists.txt' |
| 17 | + - '**/CMakeLists.txt' |
| 18 | + - '**.cmake' |
| 19 | + - '**.cmake.in' |
| 20 | + - 'docker/**' |
| 21 | + - 'vendor/**' |
| 22 | + push: |
| 23 | + branches: |
| 24 | + - main |
| 25 | + paths: |
| 26 | + - '.github/workflows/tests-windows.yaml' |
| 27 | + - '**.cpp' |
| 28 | + - '**.hpp' |
| 29 | + - '**.hpp.in' |
| 30 | + - 'CMakeLists.txt' |
| 31 | + - '**/CMakeLists.txt' |
| 32 | + - '**.cmake' |
| 33 | + - '**.cmake.in' |
| 34 | + - 'docker/**' |
| 35 | + - 'vendor/**' |
| 36 | + |
| 37 | +concurrency: |
| 38 | + group: ${{github.workflow}}-${{github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref}} |
| 39 | + cancel-in-progress: true |
| 40 | + |
| 41 | +jobs: |
| 42 | + id_repo: |
| 43 | + runs-on: windows-latest |
| 44 | + steps: |
| 45 | + - name: Identify repository |
| 46 | + id: identify_repo |
| 47 | + run: | |
| 48 | + 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" |
| 49 | + outputs: {in_base_repo: '${{steps.identify_repo.outputs.in_base_repo}}'} |
| 50 | + |
| 51 | + test-windows: |
| 52 | + if: github.ref_name != 'main' |
| 53 | + strategy: |
| 54 | + fail-fast: false |
| 55 | + matrix: |
| 56 | + cxx_version: ['17', '20'] # C++23 does not work |
| 57 | + config: ['Release'] |
| 58 | + runs-on: windows-latest |
| 59 | + env: |
| 60 | + Kokkos_ROOT: ${{github.workspace}}/opt/kokkos |
| 61 | + GTest_ROOT: ${{github.workspace}}/opt/gtest |
| 62 | + CMAKE_BUILD_PARALLEL_LEVEL: 4 |
| 63 | + steps: |
| 64 | + - name: Checkout built branch |
| 65 | + uses: actions/checkout@v4 |
| 66 | + - uses: actions/checkout@v4 |
| 67 | + with: |
| 68 | + repository: google/googletest |
| 69 | + ref: v1.16.0 |
| 70 | + path: googletest |
| 71 | + - name: Install Google test |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + cmake \ |
| 75 | + -D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ |
| 76 | + -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ |
| 77 | + -B build \ |
| 78 | + -S googletest |
| 79 | + cmake --build build --config ${{matrix.config}} |
| 80 | + cmake --install build --config ${{matrix.config}} --prefix $GTest_ROOT |
| 81 | + rm -rf build |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + with: |
| 84 | + repository: kokkos/kokkos |
| 85 | + ref: 4.6.00 |
| 86 | + path: kokkos |
| 87 | + - name: Install Kokkos |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + cmake \ |
| 91 | + -D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ |
| 92 | + -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ |
| 93 | + -D Kokkos_ENABLE_DEPRECATED_CODE_4=OFF \ |
| 94 | + -D Kokkos_ENABLE_DEPRECATION_WARNINGS=OFF \ |
| 95 | + -D Kokkos_ENABLE_SERIAL=ON \ |
| 96 | + -B build \ |
| 97 | + -S kokkos |
| 98 | + cmake --build build --config ${{matrix.config}} |
| 99 | + cmake --install build --config ${{matrix.config}} --prefix $Kokkos_ROOT |
| 100 | + rm -rf build |
| 101 | + - name: Build DDC |
| 102 | + shell: bash |
| 103 | + run: | |
| 104 | + cmake \ |
| 105 | + -D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ |
| 106 | + -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ |
| 107 | + -D DDC_GTest_DEPENDENCY_POLICY=INSTALLED \ |
| 108 | + -D DDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \ |
| 109 | + -D DDC_BUILD_KERNELS_FFT=OFF \ |
| 110 | + -D DDC_BUILD_KERNELS_SPLINES=OFF \ |
| 111 | + -D DDC_BUILD_PDI_WRAPPER=OFF \ |
| 112 | + -B build |
| 113 | + cmake --build build --config ${{matrix.config}} |
| 114 | + ctest --test-dir build --build-config ${{matrix.config}} --output-on-failure --timeout 10 --output-junit tests.xml |
| 115 | + - name: Publish Test Report |
| 116 | + uses: mikepenz/action-junit-report@v5 |
| 117 | + if: ( success() || failure() ) # always run even if the previous step fails |
| 118 | + with: |
| 119 | + report_paths: '${{github.workspace}}/build/tests.xml' |
| 120 | + - name: Run examples |
| 121 | + shell: bash |
| 122 | + run: | |
| 123 | + ./build/examples/${{matrix.config}}/game_of_life.exe |
| 124 | + ./build/examples/${{matrix.config}}/heat_equation.exe |
| 125 | + ./build/examples/${{matrix.config}}/non_uniform_heat_equation.exe |
| 126 | + ./build/examples/${{matrix.config}}/uniform_heat_equation.exe |
0 commit comments