diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab26a2f..79a64a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,18 @@ stages: - build +build linux clang format: + stage: build + image: docker + services: + - docker:dind + script: + - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin + - cd linux-clang-format + - docker build -f Dockerfile -t ${CI_REGISTRY_IMAGE}:clangformat . + - docker push ${CI_REGISTRY_IMAGE}:clangformat + + build linux x64: stage: build image: docker diff --git a/linux-clang-format/Dockerfile b/linux-clang-format/Dockerfile new file mode 100755 index 0000000..53f330d --- /dev/null +++ b/linux-clang-format/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:20.04 +LABEL maintainer="suyu" +# Create a user account suyu (UID 1027) that the container will run as +RUN useradd -m -u 1027 -s /bin/bash suyu && \ + apt-get update && apt-get -y full-upgrade && \ + apt-get install -y git gpg-agent wget && \ + wget https://apt.llvm.org/llvm-snapshot.gpg.key && apt-key add ./llvm-snapshot.gpg.key && \ + echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" >> /etc/apt/sources.list && \ + apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y clang-format-15 && \ + apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log +USER 1027