From 8d3a7327606b115dda871be54c8b8cb66d41ff90 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Wed, 3 Aug 2022 10:02:48 -0700 Subject: [PATCH] Adding shared library build test (#10351) --- kokoro/linux/cmake_shared/build.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/kokoro/linux/cmake_shared/build.sh b/kokoro/linux/cmake_shared/build.sh index 87dde411c7..1fda3dfca4 100755 --- a/kokoro/linux/cmake_shared/build.sh +++ b/kokoro/linux/cmake_shared/build.sh @@ -4,4 +4,23 @@ set -eux -# TODO(mkruskal) Implement this. \ No newline at end of file +# Change to repo root +cd $(dirname $0)/../../.. +GIT_REPO_ROOT=`pwd` + +CONTAINER_IMAGE=gcr.io/protobuf-build/cmake/linux@sha256:79e6ed9d7f3f8e56167a3309a521e5b7e6a212bfb19855c65ee1cbb6f9099671 + +# Update git submodules +git submodule update --init --recursive + +tmpfile=$(mktemp -u) + +docker run \ + --cidfile $tmpfile \ + -v $GIT_REPO_ROOT:/workspace \ + $CONTAINER_IMAGE \ + /test.sh -Dprotobuf_BUILD_CONFORMANCE=ON -Dprotobuf_BUILD_SHARED_LIBS=ON + +# Save logs for Kokoro +docker cp \ + `cat $tmpfile`:/workspace/logs $KOKORO_ARTIFACTS_DIR