forked from kokkos/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (144 loc) · 5.65 KB
/
continuous-integration-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: github-Linux
on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]
concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
permissions: read-all
jobs:
CI:
continue-on-error: true
strategy:
matrix:
distro: ['fedora:latest', 'ubuntu:latest']
cxx: ['g++', 'clang++']
cxx_extra_flags: ['']
cmake_build_type: ['Release', 'Debug']
backend: ['OPENMP']
clang-tidy: ['']
include:
- distro: 'ubuntu:intel'
cxx: 'icpc'
cxx_extra_flags: '-diag-disable=177,10441'
cmake_build_type: 'Release'
backend: 'OPENMP'
- distro: 'ubuntu:intel'
cxx: 'icpc'
cxx_extra_flags: '-diag-disable=177,10441'
cmake_build_type: 'Debug'
backend: 'OPENMP'
- distro: 'ubuntu:intel'
cxx: 'icpx'
cxx_extra_flags: '-fp-model=precise -Wno-pass-failed'
cmake_build_type: 'Release'
backend: 'OPENMP'
- distro: 'ubuntu:intel'
cxx: 'icpx'
cxx_extra_flags: '-fp-model=precise -Wno-pass-failed'
cmake_build_type: 'Debug'
backend: 'OPENMP'
- distro: 'ubuntu:latest'
cxx: 'clang++'
cxx_extra_flags: '-fsanitize=address'
extra_linker_flags: '-fsanitize=address'
cmake_build_type: 'RelWithDebInfo'
backend: 'THREADS'
clang-tidy: '-DCMAKE_CXX_CLANG_TIDY="clang-tidy;-warnings-as-errors=*"'
- distro: 'ubuntu:latest'
cxx: 'clang++'
cxx_extra_flags: '-fsanitize=address'
extra_linker_flags: '-fsanitize=address'
cmake_build_type: 'RelWithDebInfo'
backend: 'SERIAL'
- distro: 'ubuntu:latest'
cxx: 'g++'
cmake_build_type: 'RelWithDebInfo'
backend: 'THREADS'
runs-on: ubuntu-latest
container:
image: ghcr.io/kokkos/ci-containers/${{ matrix.distro }}
steps:
- name: Checkout desul
uses: actions/checkout@v4
with:
repository: desul/desul
ref: 477da9c8f40f8db369c28dd3f93a67e376d8511b
path: desul
- name: Install desul
working-directory: desul
run: |
git submodule init
git submodule update
mkdir build
cd build
cmake -DDESUL_ENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/desul-install ..
sudo cmake --build . --target install --parallel 2
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: kokkos-${{ matrix.distro }}-${{ matrix.cxx }}-${{ matrix.cmake_build_type }}-${{ matrix.openmp }}-${{ github.ref }}-${{ github.sha }}
restore-keys: kokkos-${{ matrix.distro }}-${{ matrix.cxx }}-${{ matrix.cmake_build_type }}-${{ matrix.openmp }}-${{ github.ref }}
- name: maybe_use_flang_new
if: ${{ matrix.cxx == 'clang++' && startsWith(matrix.distro,'fedora:') }}
run: echo "FC=flang-new" >> $GITHUB_ENV
- name: maybe_use_external_gtest
if: ${{ matrix.distro == 'ubuntu:latest' }}
run: sudo apt-get update && sudo apt-get install -y libgtest-dev
- name: maybe_install_clang_tidy
if: ${{ matrix.clang-tidy != '' }}
run: sudo apt-get update && sudo apt-get install -y clang-tidy
- name: Configure Kokkos
run: |
cmake -B builddir \
-DCMAKE_INSTALL_PREFIX=/usr \
${{ matrix.clang-tidy }} \
-Ddesul_ROOT=/usr/desul-install/ \
-DKokkos_ENABLE_DESUL_ATOMICS_EXTERNAL=ON \
-DKokkos_ENABLE_HWLOC=ON \
-DKokkos_ENABLE_${{ matrix.backend }}=ON \
-DKokkos_ENABLE_TESTS=ON \
-DKokkos_ENABLE_BENCHMARKS=ON \
-DKokkos_ENABLE_EXAMPLES=ON \
-DKokkos_ENABLE_DEPRECATED_CODE_4=ON \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DKokkos_ENABLE_COMPILER_WARNINGS=ON \
-DKokkos_ENABLE_IMPL_MDSPAN=ON \
-DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_extra_flags }}" \
-DCMAKE_EXE_LINKER_FLAGS="${{ matrix.extra_linker_flags }}" \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
- name: Build
run: |
ccache -z
cmake --build builddir --parallel 2
ccache -s
- name: Tests
working-directory: builddir
run: ctest --output-on-failure
- name: Test linking against build dir
if: ${{ matrix.cxx_extra_flags != '-fsanitize=address' }}
working-directory: example/build_cmake_installed
run: |
cmake -B builddir_buildtree -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DKokkos_ROOT=../../builddir
cmake --build builddir_buildtree
cmake --build builddir_buildtree --target test
- name: Test DESTDIR Install
run: DESTDIR=${PWD}/install cmake --build builddir --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install
- name: Install
run: sudo cmake --build builddir --target install
- name: Test install
if: ${{ matrix.cxx_extra_flags != '-fsanitize=address' }}
working-directory: example/build_cmake_installed
run: |
cmake -B builddir -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake --build builddir
cmake --build builddir --target test