Skip to content

Commit 6b0b03f

Browse files
Update CI
1 parent f39c0ca commit 6b0b03f

File tree

5 files changed

+112
-52
lines changed

5 files changed

+112
-52
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ BinPackArguments: false
77
IndentPPDirectives: AfterHash
88
AlwaysBreakTemplateDeclarations: true
99
BreakBeforeBinaryOperators: NonAssignment
10-
AlignConsecutiveAssignments: true
11-
ColumnLimit: 0
10+
AlignConsecutiveAssignments: Consecutive
11+
ColumnLimit: 0

.github/workflows/CI.yml

Lines changed: 87 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ name: CI
55
# Controls when the action will run.
66
on:
77
# Triggers the workflow on push or pull request events but only for the master branch
8-
push:
9-
branches: [main, develop]
8+
109
pull_request:
11-
branches: [main, develop]
10+
branches: [main]
1211

1312
# Allows you to run this workflow manually from the Actions tab
1413
workflow_dispatch:
@@ -31,21 +30,21 @@ jobs:
3130
CXX_COMPILER: g++
3231
container: "ubuntu_gcc_openmpi"
3332
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
3836
CODE_COVERAGE: "OFF"
37+
DOCKER_OPTIONS: "--cap-add SYS_PTRACE"
3938

4039
- name: "Ubuntu OpenMPI clang++"
4140
CC_COMPILER: clang
4241
CXX_COMPILER: clang++
4342
container: "ubuntu_clang_openmpi"
4443
MPIEXEC_PREFLAGS: "--allow-run-as-root --oversubscribe"
4544
USE_SANITIZER: ""
46-
CMAKE_BUILD_TYPE: Release
47-
DOCKER_OPTIONS: " "
45+
CMAKE_BUILD_TYPE: Debug
4846
CODE_COVERAGE: "OFF"
47+
DOCKER_OPTIONS: "--cap-add SYS_PTRACE"
4948

5049
- name: "Ubuntu MPICH g++"
5150
CC_COMPILER: gcc
@@ -70,27 +69,26 @@ jobs:
7069
CODE_COVERAGE: "OFF"
7170

7271
# 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"
9492

9593
- name: "Debian MPICH g++"
9694
CC_COMPILER: gcc
@@ -126,46 +124,63 @@ jobs:
126124
name: CI (${{ matrix.name }})
127125

128126
# 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]')"
130127
steps:
131128
- name: Checkout htool
132129
uses: actions/checkout@v3
133130
with:
134131
path: "htool"
132+
# ref: 14d013835eceb940b9b51dd90462fe67834db777
135133
fetch-depth: 0 # to get tags
136134
- 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
142148
143149
- name: Build tests
144150
run: |
145151
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
148154
149155
- name: Run tests
150156
run: |
151157
cd htool/build
152158
export OMP_NUM_THREADS=2
153-
${{ matrix.ASAN_OPTIONS }} ctest --output-on-failure
159+
${{ matrix.ASAN_OPTIONS }} ctest -j 4 --output-on-failure
154160
155161
- name: Build examples
156162
run: |
157163
cd htool/build
158-
make -j2 build-examples
164+
make -j 4 build-examples
159165
160166
- name: Build documentation
161167
run: |
162168
cd htool/build
163169
make doc
164170
165-
- name: Check format
171+
- name: Check c++ format
172+
uses: DoozyX/[email protected]
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
166181
run: |
182+
. /usr/local/share/venv/bin/activate
167183
cd htool/build
168-
make format
169184
make cmake-format
170185
git diff --exit-code
171186
@@ -174,10 +189,36 @@ jobs:
174189
run: |
175190
cd htool/
176191
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
178193
179-
- name: Upload coverage to Codecov
194+
- uses: actions/upload-artifact@v4
195+
with:
196+
path: coverage.info
197+
if-no-files-found: error
180198
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+
# uses: codecov/[email protected]
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
182220
with:
183-
file: htool/coverage.info
221+
fail_ci_if_error: true
222+
file: ./coverage.info
223+
token: ${{ secrets.CODECOV_TOKEN }}
224+
verbose: true

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Dotfiles
2+
.*
3+
!.gitignore
4+
!.clang-format
5+
!.clang-tidy
6+
!.devcontainer
7+
!.github
8+
19
# Compiled Object files
210
*.slo
311
*.lo

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ endif()
8787
# Options
8888
option(HTOOL_WITH_EXAMPLES "Build htool examples ?" ON)
8989
option(HTOOL_WITH_DOC "Build documentation" ON)
90+
option(HTOOL_WITH_STRICT_TESTS "Add -Werror to the tests" OFF)
9091

9192
#=============================================================================#
9293
#========================== External Libraries ===============================#
@@ -126,7 +127,12 @@ if(OpenMP_CXX_FOUND)
126127
endif()
127128
target_compile_features(htool INTERFACE cxx_std_11)
128129

129-
if("${BLA_VENDOR}" STREQUAL "Intel10_64lp_seq" OR "${BLA_VENDOR}" STREQUAL "Intel10_64lp")
130+
if("${BLA_VENDOR}" STREQUAL "Intel10_32"
131+
OR "${BLA_VENDOR}" STREQUAL "Intel10_64lp"
132+
OR "${BLA_VENDOR}" STREQUAL "Intel10_64lp_seq"
133+
OR "${BLA_VENDOR}" STREQUAL "Intel10_64ilp"
134+
OR "${BLA_VENDOR}" STREQUAL "Intel10_64ilp_seq"
135+
OR "${BLA_VENDOR}" STREQUAL "Intel10_64_dyn")
130136
target_compile_definitions(htool INTERFACE "-DHPDDM_MKL -DHTOOL_MKL")
131137
endif()
132138

@@ -182,11 +188,13 @@ if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) AND BUILD_TESTING)
182188
target_compile_options(htool INTERFACE -fprofile-arcs -ftest-coverage)
183189
target_link_libraries(htool INTERFACE gcov)
184190
endif()
191+
if(HTOOL_WITH_STRICT_TESTS)
192+
target_compile_options(htool INTERFACE -Werror)
193+
endif()
185194
target_compile_options(
186195
htool
187196
INTERFACE -Wall
188197
-Wextra
189-
-Werror
190198
-Wshadow
191199
-Wnon-virtual-dtor
192200
-pedantic
@@ -199,7 +207,7 @@ if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) AND BUILD_TESTING)
199207
-Wdouble-promotion
200208
-Wno-sign-compare
201209
-Wextra-semi
202-
# -Wzero-as-null-pointer-constant
210+
-Wzero-as-null-pointer-constant
203211
-Wundef)
204212
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
205213
target_compile_options(htool INTERFACE -Wimplicit-fallthrough -Wextra-semi-stmt -ferror-limit=200)

tests/functional_tests/solvers/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ FetchContent_Declare(
1111
GIT_SUBMODULES_RECURSE FALSE
1212
GIT_SUBMODULES "")
1313

14-
FetchContent_MakeAvailable(data_test_repository)
14+
FetchContent_GetProperties(data_test_repository)
15+
if(NOT data_test_repository_POPULATED)
16+
FetchContent_Populate(data_test_repository)
17+
endif()
1518

1619
set(Test_solver_ARGS ${data_test_repository_SOURCE_DIR}/data/)
1720

0 commit comments

Comments
 (0)