-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.56 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Use the official Ubuntu image as a base
FROM ubuntu:20.04
# Set non-interactive mode for APT
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
git \
cmake \
g++ \
lcov \
libgtest-dev \
wget \
curl \
python3 \
python3-pip \
&& apt-get clean
# Install CMake if needed
RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.sh -O /tmp/cmake.sh \
&& chmod +x /tmp/cmake.sh \
&& /tmp/cmake.sh --skip-license --prefix=/usr/local \
&& rm /tmp/cmake.sh
# Install conan
RUN pip3 install conan
# Install yaml-cpp
RUN git clone https://github.com/jbeder/yaml-cpp && cd yaml-cpp && mkdir build && cd build && cmake -DYAML_BUILD_SHARED_LIBS=ON .. && make -j8 all install
# Install tinyxml2
RUN git clone https://github.com/leethomason/tinyxml2 && cd tinyxml2 && mkdir build && cd build && cmake .. && make -j8 all install
# Install Google Benchmark
RUN git clone https://github.com/google/benchmark && cd benchmark && mkdir build && cd build && cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON .. && make -j8 all install
# Install Google Test
RUN git clone https://github.com/google/googletest && cd googletest && mkdir build && cd build && cmake .. && make -j8 all install
# Copy the project files
COPY . /app
# Set working directory
WORKDIR /app
# Build the project
RUN mkdir build && cd build && cmake -DENABLE_TESTING=ON -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --target coverage
# Set the entrypoint to run tests
CMD ["ctest", "-V"]