diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index 4a8a8f72e7f5..1b1d973d1628 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -90,6 +90,108 @@ jobs: ccache -s -v" linux-cmake: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + include: + - flags: -Dprotobuf_BUILD_EXAMPLES=ON + - name: Ninja + flags: -G Ninja + - name: Shared + flags: -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_EXAMPLES=ON + + name: Linux CMake ${{ matrix.name}} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup ccache + uses: protocolbuffers/protobuf-ci/ccache@v1 + with: + cache-prefix: linux-cmake2-${{ matrix.name }} + + - name: Run tests + uses: protocolbuffers/protobuf-ci/docker@v1 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:9836c8e6f3890cf5dd845c114c0e13b6e91ff7458290267a6f99c46d4ebd6952 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: | + cmake . \ + -DCMAKE_CXX_STANDARD=14 \ + -Dprotobuf_BUILD_TESTS=ON \ + -Dprotobuf_USE_EXTERNAL_GTEST=ON \ + -Dprotobuf_ABSL_PROVIDER=package \ + ${{ matrix.flags}} ${{ env.CCACHE_CMAKE_FLAGS }} + cmake --build . --parallel 20 + ctest --verbose --parallel 20 + ccache -s -v + + + linux-cmake-install: + name: Linux CMake Install + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup ccache + uses: protocolbuffers/protobuf-ci/ccache@v1 + with: + cache-prefix: linux-cmake-install2 + + - name: Run tests + uses: protocolbuffers/protobuf-ci/docker@v1 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:9836c8e6f3890cf5dd845c114c0e13b6e91ff7458290267a6f99c46d4ebd6952 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: | + /install.sh -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }} -Dprotobuf_USE_EXTERNAL_GTEST=ON -Dprotobuf_ABSL_PROVIDER=package + /test.sh \ + ${{ env.CCACHE_CMAKE_FLAGS }} \ + -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON \ + -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF \ + -Dprotobuf_BUILD_CONFORMANCE=ON \ + -DCMAKE_CXX_STANDARD=14 \ + -Dprotobuf_USE_EXTERNAL_GTEST=ON -Dprotobuf_ABSL_PROVIDER=package + + linux-cmake-examples: + name: Linux CMake Examples + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + ref: ${{ inputs.safe-checkout }} + submodules: recursive + + - name: Setup ccache + uses: protocolbuffers/protobuf-ci/ccache@v1 + with: + cache-prefix: linux-cmake-examples + + - name: Run tests + uses: protocolbuffers/protobuf-ci/docker@v1 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:9836c8e6f3890cf5dd845c114c0e13b6e91ff7458290267a6f99c46d4ebd6952 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: | + /install.sh -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }} -Dprotobuf_USE_EXTERNAL_GTEST=ON -Dprotobuf_ABSL_PROVIDER=package + cd examples + mkdir build + cmake -S . -B build \ + ${{ env.CCACHE_CMAKE_FLAGS }} \ + -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF \ + -DCMAKE_CXX_STANDARD=14 \ + -Dprotobuf_USE_EXTERNAL_GTEST=ON \ + -Dprotobuf_ABSL_PROVIDER=package + cmake --build build + + linux-cmake-submodules: strategy: fail-fast: false # Don't cancel all jobs if one fails. matrix: @@ -112,7 +214,7 @@ jobs: -Dprotobuf_BUILD_SHARED_LIBS=ON -DCMAKE_CXX_STANDARD=14 - name: Linux CMake ${{ matrix.name}} + name: Linux CMake (Submodules) ${{ matrix.name}} runs-on: ubuntu-latest steps: - name: Checkout pending changes @@ -137,8 +239,8 @@ jobs: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} command: ${{ matrix.command }} ${{ env.CCACHE_CMAKE_FLAGS }} - linux-cmake-install: - name: Linux CMake Install + linux-cmake-install-submodules: + name: Linux CMake Install (Submodules) runs-on: ubuntu-latest steps: - name: Checkout pending changes @@ -200,8 +302,8 @@ jobs: ctest --verbose --parallel 20; ccache -s' - linux-cmake-examples: - name: Linux CMake Examples + linux-cmake-examples-submodules: + name: Linux CMake Examples (Submodules) runs-on: ubuntu-latest steps: - name: Checkout pending changes diff --git a/cmake/gtest.cmake b/cmake/gtest.cmake index 5562380cae6a..62951ff62925 100644 --- a/cmake/gtest.cmake +++ b/cmake/gtest.cmake @@ -1,7 +1,7 @@ option(protobuf_USE_EXTERNAL_GTEST "Use external Google Test (i.e. not the one in third_party/googletest)" OFF) if (protobuf_USE_EXTERNAL_GTEST) - find_package(GTest REQUIRED) + find_package(GTest REQUIRED CONFIG) else() if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/googletest/CMakeLists.txt") message(FATAL_ERROR diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 5d5d29a73aab..a96170e28d6c 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -42,8 +42,8 @@ def protobuf_deps(): _github_archive( name = "com_google_absl", repo = "https://github.com/abseil/abseil-cpp", - commit = "b971ac5250ea8de900eae9f95e06548d14cd95fe", # Abseil LTS 20230125.2 - sha256 = "f7c2cb2c5accdcbbbd5c0c59f241a988c0b1da2a3b7134b823c0bd613b1a6880", + commit = "c2435f8342c2d0ed8101cb43adfd605fdc52dca2", # Abseil LTS 20230125.3 + sha256 = "ea1d31db00eb37e607bfda17ffac09064670ddf05da067944c4766f517876390", ) if not native.existing_rule("zlib"):