diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index 8d14e7de..b5a0973c 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -92,9 +92,11 @@ jobs: - name: Restore vcpkg installed cache uses: actions/cache@v4 + id: vcpkg-cache + if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true' with: path: build/vcpkg_installed - key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'CMakeLists.txt', 'vcpkg-triplets/**') }} + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} restore-keys: vcpkg-${{ runner.os }}- - name: Build the project @@ -126,11 +128,13 @@ jobs: - name: Restore vcpkg installed cache uses: actions/cache@v4 + id: vcpkg-cache + if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true' with: path: | build/vcpkg_installed build-boost-asio/vcpkg_installed - key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'CMakeLists.txt', 'vcpkg-triplets/**') }} + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} restore-keys: vcpkg-${{ runner.os }}- - name: Build core libraries @@ -168,11 +172,6 @@ jobs: cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_PERF_TOOLS=ON cmake --build build -j8 - - name: Verify custom vcpkg installation - run: | - mv vcpkg /tmp/vcpkg-custom - cmake -B build-2 -DINTEGRATE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE="/tmp/vcpkg-custom/scripts/buildsystems/vcpkg.cmake" - cpp20-build: name: Build with the C++20 standard needs: lint @@ -229,7 +228,7 @@ jobs: - name: Restore vcpkg and its artifacts. uses: actions/cache@v4 id: vcpkg-cache - continue-on-error: true + if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true' with: path: | ${{ github.workspace }}/vcpkg_installed @@ -238,7 +237,6 @@ jobs: key: ${{ runner.os }}-${{ matrix.triplet }}-vcpkg-${{ hashFiles('vcpkg.json') }} restore-keys: | ${{ runner.os }}-${{ matrix.triplet }}-vcpkg- - save-always: true - name: Get vcpkg(windows) if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }} @@ -387,9 +385,11 @@ jobs: - name: Restore vcpkg installed cache uses: actions/cache@v4 + id: vcpkg-cache + if: always() && steps.vcpkg-cache.outputs.cache-hit != 'true' with: path: build-osx/vcpkg_installed - key: vcpkg-${{ runner.os }}-arm64-${{ hashFiles('vcpkg.json', 'CMakeLists.txt', 'vcpkg-triplets/**') }} + key: vcpkg-${{ runner.os }}-arm64-${{ hashFiles('vcpkg.json') }} restore-keys: vcpkg-${{ runner.os }}-arm64- - name: Build libraries diff --git a/build-support/run_clang_tidy.sh b/build-support/run_clang_tidy.sh index d6e068b9..33419309 100755 --- a/build-support/run_clang_tidy.sh +++ b/build-support/run_clang_tidy.sh @@ -34,8 +34,10 @@ SCRIPT=$(which run-clang-tidy) set +e nproc if [[ $? == 0 ]]; then - python3 $SCRIPT -p build -j$(nproc) $(cat files.txt) + NUM_THREADS=$(nproc) else - python3 $SCRIPT -p build -j8 $(cat files.txt) + NUM_THREADS=8 fi +set -e +python3 $SCRIPT -p build -j$NUM_THREADS $(cat files.txt) rm -f files.txt diff --git a/lib/ClientConnection.cc b/lib/ClientConnection.cc index 8665a7e4..0a850ed0 100644 --- a/lib/ClientConnection.cc +++ b/lib/ClientConnection.cc @@ -597,7 +597,7 @@ void ClientConnection::tcpConnectAsync() { auto weakSelf = weak_from_this(); resolver_->async_resolve(service_url.host(), std::to_string(service_url.port()), - [weakSelf](const ASIO_ERROR& err, tcp::resolver::results_type results) { + [weakSelf](auto err, const auto& results) { auto self = weakSelf.lock(); if (self) { self->handleResolve(err, results); diff --git a/tests/TlsNegotiationTest.cc b/tests/TlsNegotiationTest.cc index 64f956d5..84dd55ea 100644 --- a/tests/TlsNegotiationTest.cc +++ b/tests/TlsNegotiationTest.cc @@ -135,7 +135,7 @@ TEST(TlsNegotiationTest, testTls12) { // It will fail to create producer because mock server doesn't speak Pulsar, // but we only care about the handshake. Producer producer; - client.createProducerAsync("topic", [](Result, Producer) {}); + client.createProducerAsync("topic", [](auto, const auto&) {}); // Wait for handshake ASSERT_TRUE(handshakeFuture.get()); @@ -170,7 +170,7 @@ TEST(TlsNegotiationTest, testTls13) { Client client(serviceUrl, config); - client.createProducerAsync("topic", [](Result, Producer) {}); + client.createProducerAsync("topic", [](auto, const auto&) {}); ASSERT_TRUE(handshakeFuture.get());