-
Notifications
You must be signed in to change notification settings - Fork 5
226 lines (211 loc) · 8.03 KB
/
nightly.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT
name: Nightly tests
on:
schedule:
- cron: "0 1 * * 1-5" # every weekday at 1am
jobs:
docker-build:
strategy:
fail-fast: false
matrix:
image: ['oldest', 'latest']
backend: ['cpu', 'cuda', 'hip']
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with: { tool-cache: true, large-packages: false }
- name: Checkout built branch
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg BACKEND=${{matrix.backend}} \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}} \
-t ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}} \
-t ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7} \
docker/${{matrix.image}}
test:
strategy:
fail-fast: false
matrix:
image: ['oldest', 'latest']
backend:
- name: 'cpu'
c_compiler: 'gcc'
cxx_compiler: 'g++'
ddc_extra_cxx_flags: '-Wextra-semi -Wold-style-cast'
kokkos_extra_cmake_flags: ''
- name: 'cpu'
c_compiler: 'clang'
cxx_compiler: 'clang++'
ddc_extra_cxx_flags: '-Wextra-semi -Wextra-semi-stmt -Wold-style-cast'
kokkos_extra_cmake_flags: ''
- name: 'cuda'
c_compiler: '${CUDA_GCC}'
cxx_compiler: '${CUDA_GXX}'
ddc_extra_cxx_flags: ''
kokkos_extra_cmake_flags: '-DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON -DKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE=ON -DKokkos_ARCH_AMPERE80=ON'
- name: 'hip'
c_compiler: 'hipcc'
cxx_compiler: 'hipcc'
ddc_extra_cxx_flags: ''
kokkos_extra_cmake_flags: '-DKokkos_ENABLE_HIP=ON -DKokkos_ENABLE_HIP_RELOCATABLE_DEVICE_CODE=ON -DKokkos_ENABLE_ROCTHRUST=OFF -DKokkos_ARCH_AMD_GFX90A=ON'
cxx_version: ['17', '20', '23']
cmake_build_type: ['Debug', 'Release']
exclude:
- image: 'oldest' # nvcc 11 only supports C++-17
backend:
name: 'cuda'
cxx_version: '20'
- image: 'oldest' # nvcc 11 only supports C++-17
backend:
name: 'cuda'
cxx_version: '23'
- image: 'latest' # nvcc 12 only supports C++-20
backend:
name: 'cuda'
cxx_version: '23'
runs-on: ubuntu-20.04
needs: [docker-build]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with: { tool-cache: true, large-packages: false }
- name: Checkout built branch
uses: actions/checkout@v4
with: { submodules: true }
- name: Checkout Kokkos devel branch
run: |
cd vendor/kokkos
git fetch
git checkout develop
- name: Checkout Kokkos Kernels devel branch
run: |
cd vendor/kokkos-kernels
git fetch
git checkout develop
- name: Checkout Kokkos-fft devel branch
run: |
cd vendor/kokkos-fft
git fetch
git checkout main
- name: Test
id: test
run: |
cat<<-'EOF' > run.sh
set -xe
git config --global --add safe.directory '*'
export benchmark_ROOT=$PWD/opt/benchmark
export DDC_ROOT=$PWD/opt/ddc
export GTest_ROOT=$PWD/opt/gtest
export Kokkos_ROOT=$PWD/opt/kokkos
export KokkosFFT_ROOT=$PWD/opt/kokkos-fft
export KokkosKernels_ROOT=$PWD/opt/kokkos-kernels
export CMAKE_BUILD_PARALLEL_LEVEL=4
export CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}}
export CC=${{matrix.backend.c_compiler}}
export CXX=${{matrix.backend.cxx_compiler}}
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF \
-DBENCHMARK_ENABLE_TESTING=OFF \
-DBENCHMARK_INSTALL_DOCS=OFF \
-DBENCHMARK_USE_BUNDLED_GTEST=OFF \
-B build \
-S /src/vendor/benchmark
cmake --build build
cmake --install build --prefix $benchmark_ROOT
rm -rf build
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-B build \
-S /src/vendor/googletest
cmake --build build
cmake --install build --prefix $GTest_ROOT
rm -rf build
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkos_ENABLE_DEPRECATED_CODE_4=OFF \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DKokkos_ENABLE_SERIAL=ON \
${{matrix.backend.kokkos_extra_cmake_flags}} \
-B build \
-S /src/vendor/kokkos
cmake --build build
cmake --install build --prefix $Kokkos_ROOT
rm -rf build
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON \
-B build \
-S /src/vendor/kokkos-fft
cmake --build build
cmake --install build --prefix $KokkosFFT_ROOT
rm -rf build
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkosKernels_ADD_DEFAULT_ETI=OFF \
-DKokkosKernels_ENABLE_ALL_COMPONENTS=OFF \
-DKokkosKernels_ENABLE_COMPONENT_BLAS=ON \
-DKokkosKernels_ENABLE_COMPONENT_BATCHED=ON \
-DKokkosKernels_ENABLE_COMPONENT_LAPACK=OFF \
-DKokkosKernels_ENABLE_TPL_BLAS=OFF \
-DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF \
-DKokkosKernels_ENABLE_TPL_LAPACK=OFF \
-B build \
-S /src/vendor/kokkos-kernels
cmake --build build
cmake --install build --prefix $KokkosKernels_ROOT
rm -rf build
cmake \
-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-sign-compare -pedantic-errors ${{matrix.backend.ddc_extra_cxx_flags}}" \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DDDC_BUILD_BENCHMARKS=ON \
-DDDC_benchmark_DEPENDENCY_POLICY=INSTALLED \
-DDDC_GTest_DEPENDENCY_POLICY=INSTALLED \
-DDDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \
-DDDC_KokkosFFT_DEPENDENCY_POLICY=INSTALLED \
-B build \
-S /src
cmake --build build
if [ 'xcpu' = 'x${{matrix.backend.name}}' ]
then
ctest --test-dir build --output-on-failure --timeout 10 --output-junit tests.xml
./build/examples/characteristics_advection
./build/examples/game_of_life
./build/examples/heat_equation_spectral
./build/examples/heat_equation
./build/examples/non_uniform_heat_equation
./build/examples/uniform_heat_equation
fi
cmake --install build --prefix $DDC_ROOT
rm -rf build
cmake \
-B build \
-S /src/install_test
cmake --build build
EOF
docker run \
--cidfile='docker.cid' \
-v ${PWD}:/src:ro \
ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend.name}}:${GITHUB_SHA:0:7} \
bash /src/run.sh
if docker cp "$(cat docker.cid)":/data/tests.xml /home/runner/work/ddc/ddc/tests.xml
then echo "with_report=true" >> "$GITHUB_OUTPUT"
else echo "with_report=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: ( success() || failure() ) && steps.test.outputs.with_report == 'true' # always run even if the previous step fails
with:
report_paths: '/home/runner/work/ddc/ddc/tests.xml'