mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
- Rename Docker job to **"LLVM ${{ matrix.llvm_version }}
Compatibility"** for better visibility.
- Limit `build_type` to **Debug** for MSYS2, OpenBSD, NetBSD, and Nix
jobs to reduce CI time.
- Refactor **Alpine Linux** job: updated to 3.23, simplified dependency
installation, and removed redundant LLVM matrix.
- Modernize **Docker** builds:
- Added automatic architecture detection (x86_64/ARM) for CMake
downloads.
- Generalized LLVM repository logic to support multiple Ubuntu
codenames (Focal/Jammy/Noble).
- Fixed git permissions issues in containerized builds using
`safe.directory`.
- Standardized Android build packaging and added conditional testing for
Debug builds.
44 lines
1.6 KiB
Docker
44 lines
1.6 KiB
Docker
ARG UBUNTU_VERSION=22.04
|
|
FROM ubuntu:${UBUNTU_VERSION}
|
|
|
|
ARG LLVM_VERSION=18
|
|
ARG CMAKE_VERSION=3.20.0
|
|
|
|
# Prevent interactive prompts during apt install
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
wget gnupg software-properties-common lsb-release \
|
|
zlib1g zlib1g-dev python3 ninja-build curl g++ libcurl4-openssl-dev git && \
|
|
CODENAME=$(lsb_release -cs) && \
|
|
ARCH=$(uname -m) && \
|
|
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${ARCH}.sh && \
|
|
mkdir -p /opt/cmake && \
|
|
sh cmake-${CMAKE_VERSION}-linux-${ARCH}.sh --prefix=/opt/cmake --skip-license && \
|
|
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake && \
|
|
rm cmake-${CMAKE_VERSION}-linux-${ARCH}.sh
|
|
|
|
RUN CODENAME=$(lsb_release -cs) && \
|
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
|
|
if [ "${LLVM_VERSION}" -ge 16 ]; then \
|
|
add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${LLVM_VERSION} main"; \
|
|
else \
|
|
add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME} main"; \
|
|
fi && \
|
|
apt-get update && \
|
|
apt-get install -y \
|
|
clang-${LLVM_VERSION} \
|
|
clang++-${LLVM_VERSION} \
|
|
llvm-${LLVM_VERSION} \
|
|
llvm-${LLVM_VERSION}-dev \
|
|
lld-${LLVM_VERSION} \
|
|
liblld-${LLVM_VERSION}-dev \
|
|
libpolly-${LLVM_VERSION}-dev && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN groupadd -g 1337 c3c && \
|
|
useradd -m -u 1337 -g c3c c3c
|
|
|
|
USER c3c
|
|
ENV PATH="/opt/cmake/bin:${PATH}"
|
|
WORKDIR /home/c3c |