|
| 1 | +# SPDX-FileCopyrightText: 2026 CExA-project |
| 2 | +# SPDX-License-Identifier: MIT or Apache-2.0 with LLVM-exception |
| 3 | + |
| 4 | +name: ArchInfo Tests |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + paths: |
| 9 | + - '.github/workflows/arch-info.yml' |
| 10 | + - 'archInfo/**' |
| 11 | + - '!archInfo/README.md' |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} |
| 18 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 19 | + |
| 20 | +jobs: |
| 21 | + archinfo-ci: |
| 22 | + continue-on-error: true |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + backend: ["SERIAL"] |
| 26 | + kokkos-version: ["5.0.2"] |
| 27 | + runner: ["windows-2025", "windows-11-arm", "ubuntu-22.04", "ubuntu-24.04-arm", "macos-15", "macos-15-intel"] |
| 28 | + include: |
| 29 | + - extra_cmake_build_flags: "" |
| 30 | + - extra_ctest_flags: "" |
| 31 | + - install_test_exe: "./build/main" |
| 32 | + - extra_cmake_build_flags: "--config RelWithDebInfo" |
| 33 | + runner: "windows-2025" |
| 34 | + - extra_ctest_flags: "--build-config RelWithDebInfo" |
| 35 | + runner: "windows-2025" |
| 36 | + - install_test_exe: "./build/RelWithDebInfo/main.exe" |
| 37 | + runner: "windows-2025" |
| 38 | + - extra_cmake_build_flags: "--config RelWithDebInfo" |
| 39 | + runner: "windows-11-arm" |
| 40 | + - extra_ctest_flags: "--build-config RelWithDebInfo" |
| 41 | + runner: "windows-11-arm" |
| 42 | + - install_test_exe: "./build/RelWithDebInfo/main.exe" |
| 43 | + runner: "windows-11-arm" |
| 44 | + |
| 45 | + runs-on: ${{ matrix.runner }} |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Checkout Code |
| 49 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 50 | + - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 51 | + id: cache-kokkos |
| 52 | + with: |
| 53 | + path: opt/kokkos |
| 54 | + key: archinfo-kokkos-${{ matrix.backend }}-${{ matrix.kokkos-version }}-${{ matrix.runner }} |
| 55 | + # We need to use cygpath on Windows to avoid the '\' in github.workspace |
| 56 | + # leading to incorrect paths in bash |
| 57 | + - name: Setup Windows env variables |
| 58 | + shell: bash |
| 59 | + if: ${{ contains(matrix.runner, 'windows') }} |
| 60 | + run: | |
| 61 | + echo "Kokkos_ROOT=$(cygpath "${{ github.workspace }}/opt/kokkos")" >> $GITHUB_ENV |
| 62 | + echo "CexaArchInfo_ROOT=$(cygpath "${{ github.workspace }}/archInfo/install")" >> $GITHUB_ENV |
| 63 | + - name: Setup Unix env variables |
| 64 | + shell: bash |
| 65 | + if: ${{ !contains(matrix.runner, 'windows') }} |
| 66 | + run: | |
| 67 | + echo "Kokkos_ROOT=${{ github.workspace }}/opt/kokkos" >> $GITHUB_ENV |
| 68 | + echo "CexaArchInfo_ROOT=${{ github.workspace }}/archInfo/install" >> $GITHUB_ENV |
| 69 | + - name: Checkout Kokkos |
| 70 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 71 | + if: steps.cache-kokkos.outputs.cache-hit != 'true' |
| 72 | + with: |
| 73 | + repository: kokkos/kokkos |
| 74 | + ref: ${{ matrix.kokkos-version }} |
| 75 | + path: kokkos |
| 76 | + - name: Install kokkos |
| 77 | + if: steps.cache-kokkos.outputs.cache-hit != 'true' |
| 78 | + shell: bash |
| 79 | + run: | |
| 80 | + cmake -S kokkos -B kokkos/build \ |
| 81 | + -DKokkos_ENABLE_${{ matrix.backend }}=ON \ |
| 82 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 83 | + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ |
| 84 | + -DCMAKE_INSTALL_PREFIX="$Kokkos_ROOT" |
| 85 | + cmake --build kokkos/build ${{ matrix.extra_cmake_build_flags }} -j --target install |
| 86 | + - name: Configure |
| 87 | + working-directory: ${{ github.workspace }}/archInfo |
| 88 | + shell: bash |
| 89 | + run: |
| 90 | + cmake -S . -B build |
| 91 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 92 | + -DCEXA_ARCHINFO_ENABLE_TESTS=ON |
| 93 | + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded |
| 94 | + -DCMAKE_INSTALL_PREFIX="$CexaArchInfo_ROOT" |
| 95 | + - name: Build |
| 96 | + working-directory: ${{ github.workspace }}/archInfo |
| 97 | + shell: bash |
| 98 | + run: cmake --build build ${{ matrix.extra_cmake_build_flags }} -j |
| 99 | + - name: Run tests |
| 100 | + working-directory: ${{ github.workspace }}/archInfo |
| 101 | + shell: bash |
| 102 | + run: ctest --test-dir build ${{ matrix.extra_ctest_flags }} |
| 103 | + - name: Install |
| 104 | + working-directory: ${{ github.workspace }}/archInfo |
| 105 | + shell: bash |
| 106 | + run: cmake --install build ${{ matrix.extra_cmake_build_flags }} |
| 107 | + - name: Test install |
| 108 | + working-directory: ${{ github.workspace }}/archInfo/test/install_test |
| 109 | + shell: bash |
| 110 | + run: | |
| 111 | + cmake -S . -B build \ |
| 112 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 113 | + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded |
| 114 | + cmake --build build ${{ matrix.extra_cmake_build_flags }} -j |
| 115 | + ${{ matrix.install_test_exe }} |
0 commit comments