@@ -5,10 +5,9 @@ name: CI
5
5
# Controls when the action will run.
6
6
on :
7
7
# Triggers the workflow on push or pull request events but only for the master branch
8
- push :
9
- branches : [main, develop]
8
+
10
9
pull_request :
11
- branches : [main, develop ]
10
+ branches : [main]
12
11
13
12
# Allows you to run this workflow manually from the Actions tab
14
13
workflow_dispatch :
@@ -31,21 +30,21 @@ jobs:
31
30
CXX_COMPILER : g++
32
31
container : " ubuntu_gcc_openmpi"
33
32
MPIEXEC_PREFLAGS : " --allow-run-as-root --oversubscribe"
34
- USE_SANITIZER : Address""
35
- ASAN_OPTIONS : " ASAN_OPTIONS=detect_leaks=0" # issue probably with openmpi
36
- CMAKE_BUILD_TYPE : Release
37
- DOCKER_OPTIONS : " "
33
+ USE_SANITIZER : " "
34
+ # ASAN_OPTIONS: "ASAN_OPTIONS=detect_leaks=0" # issue probably with openmpi
35
+ CMAKE_BUILD_TYPE : Debug
38
36
CODE_COVERAGE : " OFF"
37
+ DOCKER_OPTIONS : " --cap-add SYS_PTRACE"
39
38
40
39
- name : " Ubuntu OpenMPI clang++"
41
40
CC_COMPILER : clang
42
41
CXX_COMPILER : clang++
43
42
container : " ubuntu_clang_openmpi"
44
43
MPIEXEC_PREFLAGS : " --allow-run-as-root --oversubscribe"
45
44
USE_SANITIZER : " "
46
- CMAKE_BUILD_TYPE : Release
47
- DOCKER_OPTIONS : " "
45
+ CMAKE_BUILD_TYPE : Debug
48
46
CODE_COVERAGE : " OFF"
47
+ DOCKER_OPTIONS : " --cap-add SYS_PTRACE"
49
48
50
49
- name : " Ubuntu MPICH g++"
51
50
CC_COMPILER : gcc
@@ -70,27 +69,26 @@ jobs:
70
69
CODE_COVERAGE : " OFF"
71
70
72
71
# Hangs up on github
73
- # - name: "Debian OpenMPI g++"
74
- # CC_COMPILER: gcc
75
- # CXX_COMPILER: g++
76
- # container: "debian_openmpi"
77
- # MPIEXEC_PREFLAGS: "--allow-run-as-root --oversubscribe"
78
- # USE_SANITIZER: "Address"
79
- # ASAN_OPTIONS: "ASAN_OPTIONS=detect_leaks=0" # issue probably with openmpi
80
- # CMAKE_BUILD_TYPE: Debug
81
- # DOCKER_OPTIONS: " "
82
- # CODE_COVERAGE: "OFF"
83
- # # DOCKER_OPTIONS: "--cap-add SYS_PTRACE"
84
- # - name: "Debian OpenMPI clang++"
85
- # CC_COMPILER: clang
86
- # CXX_COMPILER: clang++
87
- # container: "debian_openmpi"
88
- # MPIEXEC_PREFLAGS: "--allow-run-as-root --oversubscribe"
89
- # USE_SANITIZER: ""
90
- # CMAKE_BUILD_TYPE: Debug
91
- # DOCKER_OPTIONS: " "
92
- # CODE_COVERAGE: "OFF"
93
- # DOCKER_OPTIONS: "--cap-add SYS_PTRACE"
72
+ - name : " Debian OpenMPI g++"
73
+ CC_COMPILER : gcc
74
+ CXX_COMPILER : g++
75
+ container : " debian_gcc_openmpi"
76
+ MPIEXEC_PREFLAGS : " --allow-run-as-root --oversubscribe"
77
+ USE_SANITIZER : " "
78
+ # ASAN_OPTIONS: "ASAN_OPTIONS=detect_leaks=0" # issue probably with openmpi
79
+ CMAKE_BUILD_TYPE : Debug
80
+ CODE_COVERAGE : " OFF"
81
+ DOCKER_OPTIONS : " --cap-add SYS_PTRACE"
82
+
83
+ - name : " Debian OpenMPI clang++"
84
+ CC_COMPILER : clang
85
+ CXX_COMPILER : clang++
86
+ container : " debian_clang_openmpi"
87
+ MPIEXEC_PREFLAGS : " --allow-run-as-root --oversubscribe"
88
+ USE_SANITIZER : " "
89
+ CMAKE_BUILD_TYPE : Debug
90
+ CODE_COVERAGE : " OFF"
91
+ DOCKER_OPTIONS : " --cap-add SYS_PTRACE"
94
92
95
93
- name : " Debian MPICH g++"
96
94
CC_COMPILER : gcc
@@ -126,46 +124,63 @@ jobs:
126
124
name : CI (${{ matrix.name }})
127
125
128
126
# Steps represent a sequence of tasks that will be executed as part of the job
129
- if : " !contains(github.event.head_commit.message, '[ci skip]')"
130
127
steps :
131
128
- name : Checkout htool
132
129
uses : actions/checkout@v3
133
130
with :
134
131
path : " htool"
132
+ # ref: 14d013835eceb940b9b51dd90462fe67834db777
135
133
fetch-depth : 0 # to get tags
136
134
- name : Checkout hpddm
137
- uses : actions/checkout@v3
138
- with :
139
- repository : hpddm/hpddm
140
- ref : d19056d0e3010b905fca5b73f5c48a766b8a042d
141
- path : " hpddm"
135
+ run : |
136
+ git clone https://github.com/hpddm/hpddm.git hpddm
137
+ cd hpddm && git checkout 5890d5addf3962d539dc25c441ec3ff4af93b3ab
138
+ # uses: actions/checkout@v3
139
+ # with:
140
+ # path: "hpddm"
141
+ # repository: hpddm/hpddm
142
+ # ref: afb9562c9c6673d9ff760985b104ef8d4caa3621
143
+
144
+ - name : Activate virtualenv
145
+ run : |
146
+ . /usr/local/share/venv/bin/activate
147
+ echo PATH=$PATH >> $GITHUB_ENV
142
148
143
149
- name : Build tests
144
150
run : |
145
151
cd htool && mkdir build && cd build
146
- cmake -DHTOOL_WITH_EXAMPLES=1 -DMPIEXEC_PREFLAGS="${{ matrix.MPIEXEC_PREFLAGS }}" -DUSE_SANITIZER=${{ matrix.USE_SANITIZER }} -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DCODE_COVERAGE=${{ matrix.CODE_COVERAGE }} ../
147
- make -j2 build-tests
152
+ cmake -DHTOOL_WITH_EXAMPLES=ON -DHTOOL_WITH_DOC=ON -DHTOOL_WITH_STRICT_TESTS=ON -DMPIEXEC_PREFLAGS="${{ matrix.MPIEXEC_PREFLAGS }}" -DUSE_SANITIZER=${{ matrix.USE_SANITIZER }} -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DCODE_COVERAGE=${{ matrix.CODE_COVERAGE }} ../
153
+ make -j 4 build-tests
148
154
149
155
- name : Run tests
150
156
run : |
151
157
cd htool/build
152
158
export OMP_NUM_THREADS=2
153
- ${{ matrix.ASAN_OPTIONS }} ctest --output-on-failure
159
+ ${{ matrix.ASAN_OPTIONS }} ctest -j 4 - -output-on-failure
154
160
155
161
- name : Build examples
156
162
run : |
157
163
cd htool/build
158
- make -j2 build-examples
164
+ make -j 4 build-examples
159
165
160
166
- name : Build documentation
161
167
run : |
162
168
cd htool/build
163
169
make doc
164
170
165
- - name : Check format
171
+ - name : Check c++ format
172
+
173
+ with :
174
+ source : ' htool/include htool/tests'
175
+ # exclude: './third_party ./external'
176
+ extensions : ' hpp,cpp'
177
+ clangFormatVersion : 16
178
+ style : file
179
+
180
+ - name : Check cmake format
166
181
run : |
182
+ . /usr/local/share/venv/bin/activate
167
183
cd htool/build
168
- make format
169
184
make cmake-format
170
185
git diff --exit-code
171
186
@@ -174,10 +189,36 @@ jobs:
174
189
run : |
175
190
cd htool/
176
191
lcov --capture --base-directory ./ --directory build/ --output-file coverage.info
177
- lcov --remove coverage.info '/usr/*' '*/hpddm/*' --output-file coverage.info
192
+ lcov --remove coverage.info '/usr/*' '*/hpddm/*' --output-file ../ coverage.info
178
193
179
- - name : Upload coverage to Codecov
194
+ - uses : actions/upload-artifact@v4
195
+ with :
196
+ path : coverage.info
197
+ if-no-files-found : error
180
198
if : matrix.CODE_COVERAGE == 'ON'
181
- uses : codecov/codecov-action@v2
199
+
200
+ # - name: Upload coverage to Codecov
201
+ # if: matrix.CODE_COVERAGE == 'ON'
202
+
203
+ # with:
204
+ # fail_ci_if_error: true
205
+ # files: htool/coverage.info
206
+ # token: ${{ secrets.CODECOV_TOKEN }}
207
+ # verbose: true
208
+
209
+ coverage :
210
+ runs-on : ubuntu-latest
211
+ if : ${{ success() }}
212
+ needs : [ linux ]
213
+ steps :
214
+ - uses : actions/checkout@v4
215
+ with :
216
+ fetch-depth : 0
217
+ - uses : actions/download-artifact@v4
218
+ - name : Upload coverage report
219
+ uses : codecov/codecov-action@v4
182
220
with :
183
- file : htool/coverage.info
221
+ fail_ci_if_error : true
222
+ file : ./coverage.info
223
+ token : ${{ secrets.CODECOV_TOKEN }}
224
+ verbose : true
0 commit comments