-
Notifications
You must be signed in to change notification settings - Fork 95
269 lines (245 loc) · 9.56 KB
/
tests.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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: Tests
on:
push:
pull_request:
schedule:
# run sunday moring
- cron: '30 6 * * 0'
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
standard_tests:
timeout-minutes: 60
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
BOUT_TEST_TIMEOUT: "6m"
PETSC_DIR: /usr/lib/petscdir/petsc3.12/x86_64-linux-gnu-real
PETSC_ARCH: ""
SLEPC_DIR: /usr/lib/slepcdir/slepc3.12/x86_64-linux-gnu-real/
SLEPC_ARCH: ""
OMP_NUM_THREADS: ${{ matrix.config.omp_num_threads }}
PYTHONPATH: ${{ github.workspace }}/tools/pylib
OMPI_MCA_rmaps_base_oversubscribe: yes
PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe"
MPIRUN: mpiexec -np
strategy:
fail-fast: true
matrix:
# Need this to be able to exclude the coverage job
is_master_or_next:
- ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.base_ref == 'master' || github.base_ref == 'next' }}
is_cron:
- ${{ github.event_name == 'cron' }}
config:
- name: "CMake, PETSc unreleased, ADIOS2"
os: ubuntu-24.04
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_USE_ADIOS2=ON
-DBOUT_ENABLE_PYTHON=ON
-DADIOS2_ROOT=/home/runner/local/adios2
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"
build_petsc: -petsc-main
build_petsc_branch: main
build_adios2: true
on_cron: true
- name: "Default options, Ubuntu 22.04"
os: ubuntu-22.04
cmake_options: ""
on_cron: false
- name: "Optimised, static"
os: ubuntu-latest
cmake_options: "-DCHECK=0
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_CXX_FLAGS=-Ofast
-DBOUT_ENABLE_SIGNAL=OFF
-DBOUT_ENABLE_TRACK=OFF
-DBOUT_ENABLE_BACKTRACE=OFF
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false
- name: "Debug, shared"
os: ubuntu-latest
cmake_options: "-DCHECK=4
-DCMAKE_BUILD_TYPE=Debug
-DBOUT_ENABLE_SIGNAL=ON
-DBOUT_ENABLE_TRACK=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false
- name: "Shared, release"
os: ubuntu-latest
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_OPENMP=ON
-DCMAKE_BUILD_TYPE=Release
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_BUILD_DOCS=OFF
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false
- name: "Shared, OpenMP, 3D metrics"
os: ubuntu-latest
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false
- name: "CMake, new PETSc"
os: ubuntu-latest
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"
build_petsc: -petsc
on_cron: false
- name: "Coverage"
os: ubuntu-latest
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Debug
-DCHECK=3
-DENABLE_COVERAGE=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_HDF5=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
unit_only: YES
on_cron: false
exclude:
# Don't run the coverage tests if the branch isn't master or next
- is_master_or_next: false
config:
name: "Coverage"
- is_cron: true
config:
on_cron: false
steps:
- name: Job information
run: |
echo Build: ${{ matrix.config.name }}, ${{ matrix.config.os }}
echo CMake options: ${{ matrix.config.cmake_options }}
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
libfftw3-dev
libnetcdf-dev
libnetcdf-c++4-dev
netcdf-bin
python3
python3-pip
python3-pytest
python3-numpy
python3-scipy
lcov
openmpi-bin
libopenmpi-dev
petsc-dev
slepc-dev
liblapack-dev
libparpack2-dev
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install pip packages
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Cache SUNDIALS build
uses: actions/cache@v4
with:
path: /home/runner/local
key: bout-sundials-${{ matrix.config.os }}${{ matrix.config.build_petsc }}
- name: Build SUNDIALS
run: ./.build_sundials_for_ci.sh
- name: Build PETSc
run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh ${{ matrix.config.build_petsc_branch }}
- name: Build ADIOS2
run: BUILD_ADIOS2=${{ matrix.config.build_adios2 }} ./.build_adios2_for_ci.sh
- name: Build BOUT++
run: UNIT_ONLY=${{ matrix.config.unit_only }} ./.ci_with_cmake.sh ${{ matrix.config.cmake_options }}
- name: Capture coverage
if: ${{ matrix.config.name == 'Coverage' }}
# Explicitly run the coverage capture target, because
# ci_script.sh also does the upload, and we're going to do
# that ourselves in the next step
run: |
# Ensure that there is a corresponding .gcda file for every .gcno file
# This is to try and make the coverage report slightly more accurate
# It still won't include, e.g. any solvers we don't build with though
find . -name "*.gcno" -exec sh -c 'touch -a "${1%.gcno}.gcda"' _ {} \;
make -C build code-coverage-capture
- name: Upload coverage
if: ${{ matrix.config.name == 'Coverage' }}
uses: codecov/codecov-action@v4
Fedora:
# This is its own job as it doesn't use most of the steps of the
# standard_tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build Fedora rawhide
run: ./.ci_fedora.sh setup openmpi rawhide
shell: bash
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CUDA:
timeout-minutes: 60
runs-on: ubuntu-latest
container: ghcr.io/ggeorgakoudis/boutdev-cuda:latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build minimal CUDA 12.2 @ GCC9.4.0 @ Ubuntu 20.04
run: |
. /spack/share/spack/setup-env.sh
spack env activate -p /spack-env
git config --global --add safe.directory $GITHUB_WORKSPACE
rm -rf build
cmake -S $GITHUB_WORKSPACE -B build \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DBOUT_ENABLE_RAJA=on \
-DBOUT_ENABLE_UMPIRE=on \
-DBOUT_ENABLE_CUDA=on \
-DCMAKE_CUDA_ARCHITECTURES=80 \
-DCUDA_ARCH=compute_80,code=sm_80 \
-DBOUT_ENABLE_WARNINGS=off \
-DBOUT_USE_SYSTEM_FMT=on
cd build
make -j 4