From ccc3a51e4cdbc7c34ce461829b8983e2ee010f5b Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 25 Oct 2021 16:06:43 +0200 Subject: ci: Add docker based test framework * Add documentation * Add .dockerignore: minimize docker context size to improve speed * Add Makefile: to easily run various docker stages * Add a CMake sample project to check CMake install rules --- ci/docker/toolchain/Dockerfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ci/docker/toolchain/Dockerfile (limited to 'ci/docker/toolchain') diff --git a/ci/docker/toolchain/Dockerfile b/ci/docker/toolchain/Dockerfile new file mode 100644 index 0000000..1bf25ed --- /dev/null +++ b/ci/docker/toolchain/Dockerfile @@ -0,0 +1,34 @@ +# Create a virtual environment with all tools installed +# ref: https://hub.docker.com/_/ubuntu +FROM ubuntu:latest AS env +LABEL maintainer="corentinl@google.com" +# Install system build dependencies +ENV PATH=/usr/local/bin:$PATH +RUN apt-get update -qq \ +&& DEBIAN_FRONTEND=noninteractive apt-get install -yq git wget libssl-dev build-essential \ + ninja-build python3 pkgconf libglib2.0-dev \ +&& apt-get clean \ +&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +ENTRYPOINT ["/usr/bin/bash", "-c"] +CMD ["/usr/bin/bash"] + +# Install CMake 3.21.3 +RUN wget "https://cmake.org/files/v3.21/cmake-3.21.3-linux-x86_64.sh" \ +&& chmod a+x cmake-3.21.3-linux-x86_64.sh \ +&& ./cmake-3.21.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \ +&& rm cmake-3.21.3-linux-x86_64.sh + +FROM env AS devel +WORKDIR /home/project +COPY . . + +ARG TARGET +ENV TARGET ${TARGET:-unknown} + +FROM devel AS build +RUN cmake -version +RUN ./scripts/run_integration.sh build + +FROM build AS test +RUN ./scripts/run_integration.sh qemu +RUN ./scripts/run_integration.sh test -- cgit v1.2.3