Skip to content

Commit e290658

Browse files
Fix clang tidy errors not detected as well as the errors (#544)
1 parent bda51d6 commit e290658

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

.github/workflows/ci-pr-validation.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ jobs:
9292

9393
- name: Restore vcpkg installed cache
9494
uses: actions/cache@v4
95+
id: vcpkg-cache
96+
if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true'
9597
with:
9698
path: build/vcpkg_installed
97-
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'CMakeLists.txt', 'vcpkg-triplets/**') }}
99+
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
98100
restore-keys: vcpkg-${{ runner.os }}-
99101

100102
- name: Build the project
@@ -126,11 +128,13 @@ jobs:
126128

127129
- name: Restore vcpkg installed cache
128130
uses: actions/cache@v4
131+
id: vcpkg-cache
132+
if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true'
129133
with:
130134
path: |
131135
build/vcpkg_installed
132136
build-boost-asio/vcpkg_installed
133-
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'CMakeLists.txt', 'vcpkg-triplets/**') }}
137+
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
134138
restore-keys: vcpkg-${{ runner.os }}-
135139

136140
- name: Build core libraries
@@ -168,11 +172,6 @@ jobs:
168172
cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_PERF_TOOLS=ON
169173
cmake --build build -j8
170174
171-
- name: Verify custom vcpkg installation
172-
run: |
173-
mv vcpkg /tmp/vcpkg-custom
174-
cmake -B build-2 -DINTEGRATE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE="/tmp/vcpkg-custom/scripts/buildsystems/vcpkg.cmake"
175-
176175
cpp20-build:
177176
name: Build with the C++20 standard
178177
needs: lint
@@ -229,7 +228,7 @@ jobs:
229228
- name: Restore vcpkg and its artifacts.
230229
uses: actions/cache@v4
231230
id: vcpkg-cache
232-
continue-on-error: true
231+
if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true'
233232
with:
234233
path: |
235234
${{ github.workspace }}/vcpkg_installed
@@ -238,7 +237,6 @@ jobs:
238237
key: ${{ runner.os }}-${{ matrix.triplet }}-vcpkg-${{ hashFiles('vcpkg.json') }}
239238
restore-keys: |
240239
${{ runner.os }}-${{ matrix.triplet }}-vcpkg-
241-
save-always: true
242240
243241
- name: Get vcpkg(windows)
244242
if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
@@ -387,9 +385,11 @@ jobs:
387385

388386
- name: Restore vcpkg installed cache
389387
uses: actions/cache@v4
388+
id: vcpkg-cache
389+
if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true'
390390
with:
391391
path: build-osx/vcpkg_installed
392-
key: vcpkg-${{ runner.os }}-arm64-${{ hashFiles('vcpkg.json', 'CMakeLists.txt', 'vcpkg-triplets/**') }}
392+
key: vcpkg-${{ runner.os }}-arm64-${{ hashFiles('vcpkg.json') }}
393393
restore-keys: vcpkg-${{ runner.os }}-arm64-
394394

395395
- name: Build libraries

build-support/run_clang_tidy.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ SCRIPT=$(which run-clang-tidy)
3434
set +e
3535
nproc
3636
if [[ $? == 0 ]]; then
37-
python3 $SCRIPT -p build -j$(nproc) $(cat files.txt)
37+
NUM_THREADS=$(nproc)
3838
else
39-
python3 $SCRIPT -p build -j8 $(cat files.txt)
39+
NUM_THREADS=8
4040
fi
41+
set -e
42+
python3 $SCRIPT -p build -j$NUM_THREADS $(cat files.txt)
4143
rm -f files.txt

lib/ClientConnection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ void ClientConnection::tcpConnectAsync() {
597597

598598
auto weakSelf = weak_from_this();
599599
resolver_->async_resolve(service_url.host(), std::to_string(service_url.port()),
600-
[weakSelf](const ASIO_ERROR& err, tcp::resolver::results_type results) {
600+
[weakSelf](auto err, const auto& results) {
601601
auto self = weakSelf.lock();
602602
if (self) {
603603
self->handleResolve(err, results);

tests/TlsNegotiationTest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ TEST(TlsNegotiationTest, testTls12) {
135135
// It will fail to create producer because mock server doesn't speak Pulsar,
136136
// but we only care about the handshake.
137137
Producer producer;
138-
client.createProducerAsync("topic", [](Result, Producer) {});
138+
client.createProducerAsync("topic", [](auto, const auto&) {});
139139

140140
// Wait for handshake
141141
ASSERT_TRUE(handshakeFuture.get());
@@ -170,7 +170,7 @@ TEST(TlsNegotiationTest, testTls13) {
170170

171171
Client client(serviceUrl, config);
172172

173-
client.createProducerAsync("topic", [](Result, Producer) {});
173+
client.createProducerAsync("topic", [](auto, const auto&) {});
174174

175175
ASSERT_TRUE(handshakeFuture.get());
176176

0 commit comments

Comments
 (0)