File tree Expand file tree Collapse file tree 4 files changed +29
-69
lines changed Expand file tree Collapse file tree 4 files changed +29
-69
lines changed Original file line number Diff line number Diff line change 2222 # ##########################################
2323 - name : build-docker-test
2424 run : |
25- docker build -t cpp . -f etc/docker/tests/Dockerfile.debian.bullseye
26- docker run -e BUILD_SHARED=${{ matrix.BUILD_SHARED }} --rm -i -w /tmp cpp /bin/bash
25+ docker build -t cpp . -f etc/docker/base-images/Dockerfile.debian.bullseye
26+ docker build -t cpp-test . -f etc/docker/Dockerfile.sdk-build \
27+ --build-arg BASE_TAG=cpp \
28+ --build-arg REPO_SETUP=copy \
29+ --build-arg BUILD_SHARED=${{ matrix.BUILD_SHARED }} \
30+ --build-arg BUILD_TESTS=ON \
31+ --build-arg BUILD_EXAMPLES=ON \
32+ --build-arg EXTRA_CMAKE_ARGS=\
33+ "-DVIAMCPPSDK_CLANG_TIDY=ON \
34+ -DVIAMCPPSDK_SANITIZED_BUILD=${{ matrix.BUILD_SHARED }}"
35+
36+ docker run -w /viam-cpp-sdk/build -t --entrypoint /viam-cpp-sdk/etc/docker/tests/run_test.sh cpp-test /bin/bash
Original file line number Diff line number Diff line change 44# docker build --build-arg BASE_TAG=base/bullseye --build-arg GIT_TAG=[...] etc/docker/Dockerfile.sdk-build .
55# You can substitute the bullseye image for whichever you want to use as a base.
66# Note that it is necessary to tag the base image with `-t` and then refer to it using the `BASE_TAG` arg.
7+
8+ ARG REPO_SETUP=git
9+
710ARG BASE_TAG
8- FROM ${BASE_TAG} AS build-sdk
9- ENV DEBIAN_FRONTEND=noninteractive
1011
12+ FROM ${BASE_TAG} AS repo_setup_git
1113ARG GIT_TAG
14+ ONBUILD RUN echo "Checking if GIT_TAG is set" && test -n "${GIT_TAG}"
15+ ONBUILD RUN git clone https://github.com/viamrobotics/viam-cpp-sdk/ -b ${GIT_TAG}
16+
17+ FROM ${BASE_TAG} AS repo_setup_copy
18+ ONBUILD COPY . /viam-cpp-sdk/
19+
20+ FROM repo_setup_${REPO_SETUP}
21+ ENV DEBIAN_FRONTEND=noninteractive
22+
1223ARG BUILD_TYPE=RelWithDebInfo
1324ARG BUILD_SHARED=ON
1425ARG BUILD_TESTS=OFF
1526ARG BUILD_EXAMPLES=OFF
16-
17- RUN git clone https://github.com/viamrobotics/viam-cpp-sdk/ -b ${GIT_TAG}
27+ ARG EXTRA_CMAKE_ARGS
1828
1929WORKDIR /viam-cpp-sdk
2030
@@ -25,7 +35,8 @@ RUN mkdir build && \
2535 -DBUILD_SHARED_LIBS=${BUILD_SHARED} \
2636 -DVIAMCPPSDK_OFFLINE_PROTO_GENERATION=ON \
2737 -DVIAMCPPSDK_BUILD_TESTS=${BUILD_TESTS} \
28- -DVIAMCPPSDK_BUILD_EXAMPLES=${BUILD_EXAMPLES}
38+ -DVIAMCPPSDK_BUILD_EXAMPLES=${BUILD_EXAMPLES} \
39+ ${EXTRA_CMAKE_ARGS}
2940
3041RUN cmake --build build --target install && \
3142 cmake --install build
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- mkdir build
5- cd build
6- cmake .. -G Ninja -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON \
7- -DVIAMCPPSDK_OFFLINE_PROTO_GENERATION=ON \
8- -DVIAMCPPSDK_SANITIZED_BUILD=$BUILD_SHARED \
9- -DVIAMCPPSDK_CLANG_TIDY=ON \
10- -DBUILD_SHARED_LIBS=$BUILD_SHARED
11-
12- ninja all
13- ninja install
14- INSTALL_DIR=" $( pwd) /install"
4+ BUILD_SHARED=$( grep ' BUILD_SHARED_LIBS' CMakeCache.txt | cut -d ' =' -f 2)
155
166pushd src/viam/sdk/tests
177UBSAN_OPTIONS=" print_stacktrace=1" ctest --output-on-failure
You can’t perform that action at this time.
0 commit comments