-
Notifications
You must be signed in to change notification settings - Fork 26
299 lines (270 loc) · 9.69 KB
/
github-actions.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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
name: Variorum CI
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev, releases/** ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
cc-version: [11, 10, 9]
config: [boilerplate, shared_debug_log, shared_debug, static_debug_log, static_debug, shared_release_libjustify]
exclude:
- config: shared_debug_log
cc-version: 11
- config: shared_debug_log
cc-version: 10
- config: shared_debug
cc-version: 11
- config: shared_debug
cc-version: 10
- config: static_debug_log
cc-version: 11
- config: static_debug_log
cc-version: 10
- config: static_debug
cc-version: 11
- config: static_debug
cc-version: 10
- config: shared_release_libjustify
cc-version: 11
- config: shared_release_libjustify
cc-version: 10
include:
- config: boilerplate
BUILD_SHARED_LIBS: ON
BUILD_TESTS: ON
CMAKE_BUILD_TYPE: RelWithDebInfo
ENABLE_LIBJUSTIFY: OFF
ENABLE_FORTRAN: ON
ENABLE_MPI: ON
ENABLE_OPENMP: ON
VARIORUM_DEBUG: ON
ENABLE_WARNINGS: ON
- config: shared_debug_log
BUILD_SHARED_LIBS: ON
BUILD_TESTS: OFF
CMAKE_BUILD_TYPE: Debug
ENABLE_LIBJUSTIFY: OFF
ENABLE_FORTRAN: OFF
ENABLE_MPI: OFF
ENABLE_OPENMP: OFF
VARIORUM_DEBUG: ON
- config: shared_debug
BUILD_SHARED_LIBS: ON
BUILD_TESTS: OFF
CMAKE_BUILD_TYPE: Debug
ENABLE_LIBJUSTIFY: OFF
ENABLE_FORTRAN: OFF
ENABLE_MPI: OFF
ENABLE_OPENMP: OFF
VARIORUM_DEBUG: OFF
- config: static_debug_log
BUILD_SHARED_LIBS: OFF
BUILD_TESTS: OFF
CMAKE_BUILD_TYPE: Debug
ENABLE_LIBJUSTIFY: OFF
ENABLE_FORTRAN: OFF
ENABLE_MPI: OFF
ENABLE_OPENMP: OFF
VARIORUM_DEBUG: ON
- config: static_debug
BUILD_SHARED_LIBS: OFF
BUILD_TESTS: OFF
CMAKE_BUILD_TYPE: Debug
ENABLE_LIBJUSTIFY: OFF
ENABLE_FORTRAN: OFF
ENABLE_MPI: OFF
ENABLE_OPENMP: OFF
VARIORUM_DEBUG: OFF
- config: shared_release_libjustify
BUILD_SHARED_LIBS: ON
BUILD_TESTS: OFF
CMAKE_BUILD_TYPE: Release
ENABLE_LIBJUSTIFY: ON
ENABLE_FORTRAN: OFF
ENABLE_MPI: OFF
ENABLE_OPENMP: OFF
VARIORUM_DEBUG: OFF
steps:
# Checkout variorum repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- name: Install deps on ubuntu
run: |
sudo apt-get update
sudo apt-get install cmake libhwloc-dev libjansson-dev gfortran python3-sphinx doxygen mpich gcc-${{ matrix.cc-version }} python3-breathe
cmake --version
gcc-${{ matrix.cc-version }} --version
- name: Build and install rankstr dependency
run: |
git clone https://github.com/ECP-VeloC/rankstr.git
cd rankstr
mkdir build && cd build
cmake ..
# build
VERBOSE=1 make -j
# install
sudo make -j install
- name: Build and install libjustify dependency
run: |
git clone https://github.com/llnl/libjustify.git
cd libjustify
mkdir build && cd build
cmake ../src
# build
VERBOSE=1 make -j
# install
sudo make -j install
- name: Compile check
run: |
# create out-of-source build and install dir
mkdir build && mkdir install
cd build
# setup cmake options
export CMAKE_OPTS="-DBUILD_SHARED_LIBS=${{matrix.BUILD_SHARED_LIBS}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_C_COMPILER=gcc-${{matrix.cc-version}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_TESTS=${{matrix.BUILD_TESTS}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_BUILD_TYPE=${{matrix.CMAKE_BUILD_TYPE}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_LIBJUSTIFY=${{matrix.ENABLE_LIBJUSTIFY}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_FORTRAN=${{matrix.ENABLE_FORTRAN}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_MPI=${{matrix.ENABLE_MPI}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_OPENMP=${{matrix.ENABLE_OPENMP}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DVARIORUM_DEBUG=${{matrix.VARIORUM_DEBUG}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_WARNINGS=${{matrix.ENABLE_WARNINGS}}"
export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=../install"
echo ${CMAKE_OPTS}
cmake ${CMAKE_OPTS} ../src
# build
VERBOSE=1 make -j
# install
make -j install
check-code-format:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7]
steps:
# Checkout variorum repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- name: Check license headers
run: |
cd ${GITHUB_WORKSPACE}
python scripts/license.py verify
- name: Style check c/cpp/h files
run: |
sudo apt-get update
sudo apt-get install astyle
astyle --version
cd ${GITHUB_WORKSPACE}
./scripts/.ci-check-code-format.sh
err=$?
if [ $err -eq 0 ]; then exit 0; else echo -e "Formatting issue found in C/C++ files. Please run ./scripts/check-code-format.sh"; exit 1; fi
- name: Install python dependencies
run: |
python -m pip install --upgrade pip rstfmt
- name: Update Black
run: |
pip install black==21.12b0
pip install flake8==4.0.1
- name: Style check python files
run: |
cd ${GITHUB_WORKSPACE}
flake8
# specify excluded dirs on command line
black --diff --check --exclude "/(src/thirdparty_builtin/googletest|build|src/docs)/" .
- name: Style check docs files
run: |
cd ${GITHUB_WORKSPACE}
./scripts/.ci-check-rst-format.sh
# build-with-spack-mirrors:
# runs-on: ubuntu-latest
#
# env:
# BUILD_SHARED_LIBS: ON
# BUILD_TESTS: ON
# CMAKE_BUILD_TYPE: RelWithDebInfo
# ENABLE_FORTRAN: ON
# ENABLE_MPI: ON
# ENABLE_OPENMP: ON
# VARIORUM_DEBUG: OFF
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Install deps on ubuntu
# run: |
# sudo apt-get update
# sudo apt-get install cmake gfortran python3-sphinx doxygen mpich python3-breathe
# cmake --version
# gcc --version
#
# - name: Clone spack
# uses: actions/checkout@v2
# with:
# repository: spack/spack
# path: spack
# ref: releases/v0.17
# token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Clone spack mirrors
# uses: actions/checkout@v2
# with:
# repository: llnl/variorum-spack-mirrors
# path: variorum-spack-mirrors
# ref: main
# token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Setup spack and add local mirrors
# run: |
# SPACK_BIN=${PWD}/spack/bin
# echo "${SPACK_BIN}" >> ${GITHUB_PATH}
# export PATH=${SPACK_BIN}:${PATH}
# which spack
# echo -e "spack version: $(spack --version)"
# ls ${GITHUB_WORKSPACE}
# spack mirror add local_filesystem file://${GITHUB_WORKSPACE}/variorum-spack-mirrors
# echo -e "Setting spack mirror"
# ls variorum-spack-mirrors
#
# - name: Install variorum deps
# run: |
# cd ${GITHUB_WORKSPACE}
# # Install hwloc
# spack install hwloc
# hwloc_dir=`ls -d ${PWD}/spack/opt/spack/*/*/hwloc-*`
# echo "HWLOC_DIR=${hwloc_dir}" >> ${GITHUB_ENV}
# # Install jansson
# spack install jansson
# jansson_dir=`ls -d ${PWD}/spack/opt/spack/*/*/jansson-*`
# echo "JANSSON_DIR=${jansson_dir}" >> ${GITHUB_ENV}
# # Install rankstr
# spack install rankstr
# rankstr_dir=`ls -d ${PWD}/spack/opt/spack/*/*/rankstr-*`
# echo "RANKSTR_DIR=${rankstr_dir}" >> ${GITHUB_ENV}
#
# - name: Compile check
# run: |
# # create out-of-source build and install dir
# mkdir build && mkdir install
# cd build
# # setup cmake options
# export CMAKE_OPTS="-DBUILD_SHARED_LIBS=${{env.BUILD_SHARED_LIBS}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_TESTS=${{env.BUILD_TESTS}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_FORTRAN=${{env.ENABLE_FORTRAN}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_MPI=${{env.ENABLE_MPI}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DVARIORUM_DEBUG=${{env.VARIORUM_DEBUG}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DUSE_MSR_SAFE_BEFORE_1_5_0=${{env.USE_MSR_SAFE_BEFORE_1_5_0}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DHWLOC_DIR=${{env.HWLOC_DIR}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DJANSSON_DIR=${{env.JANSSON_DIR}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DRANKSTR_DIR=${{env.RANKSTR_DIR}}"
# export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=../install"
# echo ${CMAKE_OPTS}
# cmake ${CMAKE_OPTS} ../src
# # build
# VERBOSE=1 make -j
# # install
# make -j install