Inital commit
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
name: Docker Builders
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ github.ref_name }}
|
||||||
|
BASE_BUILDER_TAG: ${{ vars.DOCKER_IMAGE }}/linuxbasebuilder
|
||||||
|
CPP_BUILDER_TAG: ${{ vars.DOCKER_IMAGE }}/linuxcppbuilder
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-base-builder:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 360
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set ENV
|
||||||
|
run: |
|
||||||
|
echo "BRANCH_NAME_LOWER=$(echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
|
echo "BRANCH_NAME=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ env.BASE_BUILDER_TAG }}:${{ env.BRANCH_NAME_LOWER }} --no-cache ./Linux/BaseBuilder
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.DOCKER_TOKEN }}" | docker login ${{ vars.DOCKER_REGISTRY }} \
|
||||||
|
-u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: |
|
||||||
|
docker push ${{ env.BASE_BUILDER_TAG }}:${{ env.BRANCH_NAME_LOWER }}
|
||||||
|
|
||||||
|
build-cpp-builder:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 360
|
||||||
|
needs: build-base-builder
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set ENV
|
||||||
|
run: |
|
||||||
|
echo "BRANCH_NAME_LOWER=$(echo $GITHUB_REF_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
|
echo "BRANCH_NAME=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ env.CPP_BUILDER_TAG }}:${{ env.BRANCH_NAME_LOWER }} --build-arg BASE_BUILDER=${{ env.BASE_BUILDER_TAG }}:${{ env.BRANCH_NAME_LOWER }} --no-cache ./Linux/CPPBuilder
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.DOCKER_TOKEN }}" | docker login ${{ vars.DOCKER_REGISTRY }} \
|
||||||
|
-u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: |
|
||||||
|
docker push ${{ env.CPP_BUILDER_TAG }}:${{ env.BRANCH_NAME_LOWER }}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022-2023 Romain BOULLARD
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
# Set timezone, noninteractive mode, and pipx path
|
||||||
|
ENV TZ=Europe/Paris \
|
||||||
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
|
PATH="/root/.local/bin:$PATH"
|
||||||
|
|
||||||
|
# Use build cache for ccache
|
||||||
|
RUN --mount=type=cache,target=/ccache
|
||||||
|
|
||||||
|
# Dummy sudo (no security weakening)
|
||||||
|
RUN echo '#!/bin/bash\n$@' > /usr/bin/sudo \
|
||||||
|
&& chmod +x /usr/bin/sudo
|
||||||
|
|
||||||
|
# Install base dependencies in one layer
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
unzip \
|
||||||
|
curl \
|
||||||
|
wget \
|
||||||
|
lsb-release \
|
||||||
|
software-properties-common \
|
||||||
|
gnupg \
|
||||||
|
python3
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Build arguments
|
||||||
|
ARG BASE_BUILDER
|
||||||
|
|
||||||
|
# Base image
|
||||||
|
FROM $BASE_BUILDER
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
cppcheck \
|
||||||
|
ccache \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
git \
|
||||||
|
pkg-config \
|
||||||
|
wget \
|
||||||
|
lsb-release \
|
||||||
|
software-properties-common \
|
||||||
|
pipx
|
||||||
|
|
||||||
|
ENV PATH="/root/.local/bin:${PATH}"
|
||||||
|
|
||||||
|
# Install LLVM 22 and symlink tools
|
||||||
|
RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh \
|
||||||
|
&& chmod +x /tmp/llvm.sh \
|
||||||
|
&& /tmp/llvm.sh 22 all \
|
||||||
|
&& for f in /usr/lib/llvm-22/bin/*; do \
|
||||||
|
ln -sf "$f" "/usr/local/bin/$(basename "$f")"; \
|
||||||
|
done \
|
||||||
|
&& rm -f /tmp/llvm.sh*
|
||||||
|
|
||||||
|
RUN VERSION=1.2.0; \
|
||||||
|
curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux-x86_64-v$VERSION.tar.xz" \
|
||||||
|
| tar -C /opt -xJ && \
|
||||||
|
ln -s "/opt/infer-linux-x86_64-v$VERSION/bin/infer" /usr/bin/infer
|
||||||
|
|
||||||
|
# Install pipx and Conan
|
||||||
|
RUN pipx install conan \
|
||||||
|
&& pipx install gcovr
|
||||||
|
|
||||||
|
# Build and install mold
|
||||||
|
RUN git clone --branch v2.41.0 https://github.com/rui314/mold.git /tmp/mold \
|
||||||
|
&& cd /tmp/mold \
|
||||||
|
&& cmake . -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_COMPILER=clang++ \
|
||||||
|
-B build \
|
||||||
|
&& cmake --build build -j$(nproc) \
|
||||||
|
&& cmake --install build \
|
||||||
|
&& rm -rf /tmp/mold
|
||||||
|
|
||||||
|
# Configure Conan with custom profiles and remote
|
||||||
|
RUN conan config install https://git.romainboullard.com/BigfootDev/ConanProfiles.git --args="--branch main" \
|
||||||
|
&& conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages \
|
||||||
|
&& conan remote disable conancenter
|
||||||
|
|
||||||
|
# Install Vulkan SDK 1.4.341.0
|
||||||
|
RUN wget -q https://sdk.lunarg.com/sdk/download/1.4.341.0/linux/vulkansdk-linux-x86_64-1.4.341.0.tar.xz \
|
||||||
|
-O /tmp/vulkansdk.tar.xz \
|
||||||
|
&& mkdir -p /opt/vulkan \
|
||||||
|
&& tar -xf /tmp/vulkansdk.tar.xz -C /opt/vulkan \
|
||||||
|
&& rm /tmp/vulkansdk.tar.xz
|
||||||
|
|
||||||
|
ENV VULKAN_SDK=/opt/vulkan/1.4.341.0/x86_64
|
||||||
|
ENV PATH="${VULKAN_SDK}/bin:${PATH}"
|
||||||
|
ENV LD_LIBRARY_PATH="${VULKAN_SDK}/lib:${LD_LIBRARY_PATH}"
|
||||||
|
ENV VK_LAYER_PATH="${VULKAN_SDK}/share/vulkan/explicit_layer.d"
|
||||||
|
ENV VK_ADD_LAYER_PATH="${VULKAN_SDK}/share/vulkan/explicit_layer.d"
|
||||||
|
ENV PKG_CONFIG_PATH="${VULKAN_SDK}/lib/pkgconfig/:${PKG_CONFIG_PATH}"
|
||||||
Reference in New Issue
Block a user