make: clean ci

This commit is contained in:
Corentin Le Molgat
2024-11-15 09:51:34 +01:00
parent 5ac716336b
commit 25ae8eed2a
8 changed files with 3 additions and 128 deletions

View File

@@ -52,7 +52,6 @@ help:
@echo -e "\tWith ${BOLD}<distro>${RESET}:"
@echo -e "\t\t${BOLD}alpine${RESET} (edge)"
@echo -e "\t\t${BOLD}archlinux${RESET} (latest)"
@echo -e "\t\t${BOLD}centos${RESET} (latest)"
@echo -e "\t\t${BOLD}debian${RESET} (latest)"
@echo -e "\t\t${BOLD}fedora${RESET} (latest)"
@echo -e "\t\t${BOLD}opensuse${RESET} (tumbleweed)"
@@ -111,7 +110,7 @@ endif
DOCKER_RUN_CMD := docker run --rm --init --net=host
# Currently supported distro
DISTROS = alpine archlinux centos debian fedora opensuse ubuntu
DISTROS = alpine archlinux debian fedora opensuse ubuntu
LANGUAGES = cpp python java dotnet
# $* stem

View File

@@ -1,44 +0,0 @@
# Create a virtual environment with all tools installed
# ref: https://quay.io/repository/centos/centos
FROM quay.io/centos/centos:stream AS base
# Install system build dependencies
ENV PATH=/usr/local/bin:$PATH
RUN dnf -y update \
&& dnf -y install \
git wget which redhat-lsb-core openssl-devel pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "Development Tools" \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# Install system build dependencies
ENV PATH=/usr/local/bin:$PATH
RUN dnf -y update \
&& dnf -y install gcc-toolset-11 \
&& dnf clean all \
&& rm -rf /var/cache/dnf
RUN echo "source /opt/rh/gcc-toolset-11/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]
# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]
# Install SWIG 4.2.1
FROM base AS swig
RUN dnf -y update \
&& dnf -y install pcre2-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.2.1/swig-4.2.1.tar.gz" \
&& tar xvf swig-4.2.1.tar.gz \
&& rm swig-4.2.1.tar.gz \
&& cd swig-4.2.1 \
&& ./configure --prefix=/usr \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf swig-4.2.1

View File

@@ -1,15 +0,0 @@
FROM ortools/make:centos_base AS env
RUN make -version
FROM env AS devel
WORKDIR /home/project
COPY . .
FROM devel AS build
RUN make cpp
FROM build AS test
RUN make test_cpp
FROM build AS package
RUN make package_cpp

View File

@@ -1,22 +0,0 @@
FROM ortools/make:centos_swig AS env
# see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-centos8
RUN dnf -y update \
&& dnf -y install dotnet-sdk-6.0 \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
# Add the library src to our build env
FROM env AS devel
WORKDIR /home/project
COPY . .
FROM devel AS build
RUN make dotnet
FROM build AS test
RUN make test_dotnet
FROM build AS package
RUN make package_dotnet

View File

@@ -1,18 +0,0 @@
FROM ortools/make:centos_swig AS env
RUN dnf -y update \
&& dnf -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel maven \
&& dnf clean all \
&& rm -rf /var/cache/dnf
FROM env AS devel
WORKDIR /home/project
COPY . .
FROM devel AS build
RUN make java
FROM build AS test
RUN make test_java
FROM build AS package
RUN make package_java

View File

@@ -1,19 +0,0 @@
FROM ortools/make:centos_swig AS env
RUN dnf -y update \
&& dnf -y install python3.11-devel python3.11-numpy python3.11-pip \
&& dnf clean all \
&& rm -rf /var/cache/dnf
RUN python3.11 -m pip install absl-py mypy mypy-protobuf pandas
FROM env AS devel
WORKDIR /home/project
COPY . .
FROM devel AS build
RUN make python
FROM build AS test
RUN make test_python
FROM build AS package
RUN make package_python

View File

@@ -6,7 +6,7 @@ ENV PATH=/usr/local/bin:$PATH
RUN dnf -y update \
&& dnf -y install git wget \
which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install @development-tools \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
CMD [ "/usr/bin/bash" ]

View File

@@ -6,15 +6,9 @@ ENV PATH=/usr/local/bin:$PATH
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
git wget libssl-dev pkg-config build-essential \
autoconf libtool zlib1g-dev lsb-release \
cmake autoconf libtool zlib1g-dev lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]
FROM base AS swig