Skip to content

Commit b9f7617

Browse files
authored
Fix CI builds with ubuntu-latest (#10)
* Fix CI builds with ubuntu-latest - gcc10 is no longer available on ubuntu-latest - ubuntu-latest no longer supports Format.cmake 1.8.1, see TheLartians/Format.cmake#45 - Format.cmake 1.8.3 now tries to format json, which needs changes to the clang-format configuration file * Print cpp formatting problems on CI * Fix clang-format
1 parent 85a5835 commit b9f7617

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.clang-format

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,8 @@ SpacesInParentheses: 'false'
6060
SpacesInSquareBrackets: 'false'
6161
Standard: Cpp11
6262
UseTab: Never
63-
63+
---
64+
Language: Json
65+
BasedOnStyle: llvm
66+
IndentWidth: '4'
6467
...

.github/workflows/clang-format-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ jobs:
2424
run: cmake --preset=release
2525
- name: Check C++ Formatting
2626
run: cmake --build build --target check-clang-format
27+
- name: Print C++ Formatting Problems
28+
if: failure()
29+
run: |
30+
find . -iname '*.cpp' -o -iname '*.hpp' | xargs clang-format -i
31+
git diff
2732
- name: Check CMake Formatting
2833
run: cmake --build build --target check-cmake-format

.github/workflows/ctest.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest]
13-
compiler: [{cpp: g++-10, c: gcc-10}]
13+
version: [11, 12, 13]
14+
15+
name: Build (GCC ${{ matrix.version }})
1416

1517
runs-on: ${{ matrix.os }}
1618

@@ -23,13 +25,12 @@ jobs:
2325
- name: Prepare build environment
2426
run: |
2527
sudo apt update
26-
sudo apt-get install ninja-build gcovr
28+
sudo apt-get install ninja-build gcovr cmake gcc-${{ matrix.version }} g++-${{ matrix.version }}
29+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} ${{ matrix.version }}
30+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} ${{ matrix.version }}
2731
2832
- name: Configure CMake
2933
run: cmake --preset=debug -DPASTA_BIT_VECTOR_BUILD_TESTS=On -DPASTA_BIT_VECTOR_COVERAGE_REPORTING=On
30-
env:
31-
CC: gcc-10
32-
CXX: g++-10
3334

3435
- name: Build
3536
run: cmake --build ${{github.workspace}}/debug/

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (PROJECT_IS_TOP_LEVEL)
3737
FetchContent_Declare(
3838
Format.cmake
3939
GIT_REPOSITORY https://github.com/TheLartians/Format.cmake
40-
GIT_TAG v1.8.1
40+
GIT_TAG v1.8.3
4141
)
4242
FetchContent_MakeAvailable(Format.cmake)
4343

benchmarks/bit_vector_benchmark.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,8 @@ class BitVectorBenchmark {
233233

234234
LOG << LOG_PREFIX << "Finished PaStA bit vector benchmark";
235235

236-
std::cout << "RESULT "
237-
<< "algo=" << name << " "
238-
<< "bit_size=" << bit_size_ << " "
239-
<< "fill_percentage=" << fill_percentage_ << " "
236+
std::cout << "RESULT " << "algo=" << name << " " << "bit_size=" << bit_size_
237+
<< " " << "fill_percentage=" << fill_percentage_ << " "
240238
<< "bv_construction_time=" << bv_construction_time << " "
241239
#if defined(DNDEBUG)
242240
<< "bv_construction_mem=" << bv_construction_mem.cur_peak << " "

0 commit comments

Comments
 (0)