This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
265 lines (263 loc) · 10.6 KB
/
ci.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
name: PeleLM-CI
on:
push:
branches: [development]
pull_request:
branches: [development]
jobs:
#Formatting:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: DoozyX/[email protected]
# with:
# source: './Source ./Exec'
# exclude: '.'
# extensions: 'H,h,cpp'
# clangFormatVersion: 11
CMake:
#needs: Formatting
runs-on: ${{matrix.os}}
strategy:
matrix:
# Not easy to get fortran found by CMake on MacOS here
#os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
include:
#- os: macos-latest
# install_deps: brew install open-mpi automake
# comp: llvm
# procs: $(sysctl -n hw.ncpu)
# mpipreflags: -DMPIEXEC_PREFLAGS:STRING=--oversubscribe
- os: ubuntu-latest
install_deps: sudo apt-get install mpich libmpich-dev
comp: gnu
procs: $(nproc)
mpipreflags:
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{github.token}}
- uses: actions/checkout@v2
with:
submodules: true
- name: Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Setup
run: |
echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV
cmake -E make_directory ${{runner.workspace}}/deps
- name: Dependencies
run: |
# Install MPI
${{matrix.install_deps}}
## Install MetaPhysicL
#cd ${{runner.workspace}}/deps
#git clone --recursive https://github.com/roystgnr/MetaPhysicL.git ${{runner.workspace}}/deps/MetaPhysicL
#cd ${{runner.workspace}}/deps/MetaPhysicL
#./bootstrap
#./configure --prefix="${{runner.workspace}}/deps/install/MetaPhysicL"
#make -j ${{env.NPROCS}}
#make install
## Install MASA
#cd ${{runner.workspace}}/deps
#git clone --recursive https://github.com/manufactured-solutions/MASA.git ${{runner.workspace}}/deps/MASA
#cd ${{runner.workspace}}/deps/MASA
#./bootstrap
#./configure CXX='mpicxx -std=c++11' CC=mpicc \
# METAPHYSICL_DIR="${{runner.workspace}}/deps/install/MetaPhysicL" \
# --prefix="${{runner.workspace}}/deps/install/MASA"
#make -j ${{env.NPROCS}}
#make install
# Install Python packages
python -m pip install --upgrade pip
pip install nose numpy pandas
- name: Configure
run: |
for DIM in 3; do \
if [ "${DIM}" != '3' ]; then WARNINGS=OFF; else WARNINGS=ON; fi; \
printf "\n-------- Configuring ${DIM}D --------\n"; \
cmake -B${{runner.workspace}}/build-${DIM}d-${{matrix.os}} \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DPELELM_DIM:STRING=${DIM} \
-DPELELM_ENABLE_MPI:BOOL=ON \
${{matrix.mpipreflags}} \
-DPELELM_ENABLE_TESTS:BOOL=ON \
-DPELELM_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DPELELM_ENABLE_MASA:BOOL=OFF \
-DPELELM_ENABLE_ALL_WARNINGS:BOOL=${WARNINGS} \
${{github.workspace}}; \
done
- name: Build
run: |
for DIM in 3; do \
printf "\n-------- Building ${DIM}D --------\n"; \
cmake --build ${{runner.workspace}}/build-${DIM}d-${{matrix.os}} \
--parallel ${{env.NPROCS}} 2>&1 | tee -a ${{runner.workspace}}/build-output.txt; \
done
- name: Report
run: |
#echo "::add-matcher::.github/problem-matchers/gcc.json"
cat ${{runner.workspace}}/build-output.txt | egrep "warning:|error:" | sort | uniq | sort -nr | \
awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}'
##- name: Test
## run: |
## for DIM in 3; do \
## printf "\n-------- Testing ${DIM}D --------\n"; \
## cd ${{runner.workspace}}/build-${DIM}d-${{matrix.os}}; \
## ctest -j ${{env.NPROCS}} -LE no-ci --output-on-failure; \
## done
#GNUmake:
# needs: Formatting
# runs-on: ubuntu-latest
# steps:
# - name: Cancel previous runs
# uses: styfle/[email protected]
# with:
# access_token: ${{github.token}}
# - uses: actions/checkout@v2
# with:
# submodules: true
# - name: Setup
# run: |
# echo "NPROCS=$(nproc)" >> $GITHUB_ENV
# printf "CC=gcc-8\nCXX=g++-8\nFC=gfortran-8\nF90=gfortran-8" >> ./Submodules/AMReX/Tools/GNUMake/Make.local
# - name: PMF debug make
# working-directory: ./ExecCpp/RegTests/PMF
# run: make -j ${{env.NPROCS}} COMP=gnu USE_MPI=FALSE DEBUG=TRUE
# - name: PMF debug test
# working-directory: ./ExecCpp/RegTests/PMF
# run: ./Pele3d.gnu.DEBUG.ex tests/pmf-1/pmf-1.i max_step=2 amr.plot_files_output=0 amr.checkpoint_files_output=0
# - name: EB debug build
# working-directory: ./ExecCpp/RegTests/EB-C10
# run: make -j ${{env.NPROCS}} COMP=gnu USE_MPI=FALSE DEBUG=TRUE
# - name: EB debug test
# working-directory: ./ExecCpp/RegTests/EB-C10
# run: ./Pele3d.gnu.DEBUG.ex tests/eb-c10/eb-c10.i max_step=2 amr.plot_files_output=0 amr.checkpoint_files_output=0
#CUDA:
# #needs: Formatting
# runs-on: ubuntu-latest
# name: CUDA v${{matrix.cuda_ver}}
# strategy:
# matrix:
# #cuda_pkg: [11-1, 10-2]
# cuda_pkg: [11-1]
# include:
# - cuda_ver: "11.1"
# cuda_pkg: 11-1
# cuda_extra: libcurand-dev-11-1 cuda-cupti-dev-11-1 libcusparse-dev-11-1 libcusolver-dev-11-1 libcublas-dev-11-1
# #- cuda_ver: "10.2"
# # cuda_pkg: 10-2
# # cuda_extra: cuda-curand-dev-10-2 cuda-cupti-dev-10-2
# steps:
# - name: Cancel previous runs
# uses: styfle/[email protected]
# with:
# access_token: ${{github.token}}
# - uses: actions/checkout@v2
# with:
# submodules: true
# - name: Dependencies
# run: |
# export DEBIAN_FRONTEND=noninteractive
# wget -q -O - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | sudo apt-key add -
# echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
# echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/nvidia-ml.list
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends \
# libopenmpi-dev cuda-command-line-tools-${{matrix.cuda_pkg}} \
# cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} \
# cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} ${{matrix.cuda_extra}}
# - name: Configure
# run: |
# echo "NPROCS=$(nproc)" >> $GITHUB_ENV
# export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH}
# cmake -Bbuild-${{matrix.cuda_pkg}} \
# -DPELELM_ENABLE_MPI=OFF \
# -DPELELM_ENABLE_CUDA=ON \
# -DAMReX_CUDA_ERROR_CAPTURE_THIS:BOOL=ON \
# -DAMReX_CUDA_ARCH=Volta \
# ${{github.workspace}}
# - name: Build
# run: cmake --build build-${{matrix.cuda_pkg}} --parallel ${{env.NPROCS}}
cppcheck:
#needs: Formatting
runs-on: ubuntu-20.04
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{github.token}}
- uses: actions/checkout@v2
with:
submodules: true
- name: Dependencies
run: sudo apt-get install -y cppcheck
- name: Configure
run: |
cmake -B${{runner.workspace}}/build-cppcheck \
-DPELELM_ENABLE_MPI:BOOL=OFF \
-DPELELM_ENABLE_TESTS:BOOL=ON \
-DPELELM_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DPELELM_ENABLE_MASA:BOOL=OFF \
-DPELELM_ENABLE_CPPCHECK:BOOL=ON \
${{github.workspace}}
- name: Check
working-directory: ${{runner.workspace}}/build-cppcheck
run: make cppcheck
- name: Full report
working-directory: ${{runner.workspace}}/build-cppcheck/cppcheck
run: cat cppcheck-full-report.txt
- name: Short report
working-directory: ${{runner.workspace}}/build-cppcheck
run: |
#echo "::add-matcher::.github/problem-matchers/cppcheck.json"
cat cppcheck-warnings.txt
clang-tidy:
#needs: Formatting
runs-on: ubuntu-20.04
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{github.token}}
- uses: actions/checkout@v2
with:
submodules: true
- name: Dependencies
run: |
sudo apt-get install -y clang-tidy-10
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-10 100
- name: Configure
run: |
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
cmake -B${{runner.workspace}}/build-clang-tidy \
-DCMAKE_CXX_COMPILER:STRING=clang++ \
-DCMAKE_C_COMPILER:STRING=clang \
-DCMAKE_Fortran_COMPILER:STRING=gfortran \
-DPELELM_ENABLE_MPI:BOOL=OFF \
-DPELELM_ENABLE_TESTS:BOOL=ON \
-DPELELM_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DPELELM_ENABLE_MASA:BOOL=OFF \
-DPELELM_ENABLE_CLANG_TIDY:BOOL=ON \
${{github.workspace}}
- name: Check
working-directory: ${{runner.workspace}}/build-clang-tidy
run: |
cmake --build . --parallel ${{env.NPROCS}} 2> clang-tidy-full-report.txt
cat clang-tidy-full-report.txt | grep "warning:" | \
egrep -v "amrex|sundials|PelePhysics|IAMR|AMReX-Hydro|googletest" | sort | uniq | sort -nr | \
awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > clang-tidy-warnings.txt
- name: Full report
working-directory: ${{runner.workspace}}/build-clang-tidy
run: cat clang-tidy-full-report.txt
- name: Short report
working-directory: ${{runner.workspace}}/build-clang-tidy
run: |
#echo "::add-matcher::.github/problem-matchers/gcc.json"
cat clang-tidy-warnings.txt