From 99e750fd3f30f2c211f7c0c86b44eed37f183560 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Tue, 16 Jul 2024 09:43:39 +0200 Subject: [PATCH] * Add `run-clang-format.py` script to `build-env-base` image * Refactor `everest-clang-format` image to use `build-env-base` as base image * Update github action `run-glang-format` to use new `everest-clang-format` image Signed-off-by: Andreas Heinrich --- docker/images/build-env-base/Dockerfile | 2 ++ .../run-clang-format.py | 0 docker/images/everest-clang-format/Dockerfile | 15 ++------------- github-actions/run-clang-format/action.yaml | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) rename docker/images/{everest-clang-format => build-env-base}/run-clang-format.py (100%) diff --git a/docker/images/build-env-base/Dockerfile b/docker/images/build-env-base/Dockerfile index e825f75..f6f8fa2 100644 --- a/docker/images/build-env-base/Dockerfile +++ b/docker/images/build-env-base/Dockerfile @@ -26,6 +26,8 @@ RUN apt update \ RUN ln -s /usr/bin/clang-format-15 /usr/bin/clang-format \ && ln -s /usr/bin/clang-tidy-15 /usr/bin/clang-tidy +COPY run-clang-format.py /usr/bin/run-clang-format + # additional packages RUN apt update \ && apt install --no-install-recommends -y \ diff --git a/docker/images/everest-clang-format/run-clang-format.py b/docker/images/build-env-base/run-clang-format.py similarity index 100% rename from docker/images/everest-clang-format/run-clang-format.py rename to docker/images/build-env-base/run-clang-format.py diff --git a/docker/images/everest-clang-format/Dockerfile b/docker/images/everest-clang-format/Dockerfile index 4e78acd..736e718 100644 --- a/docker/images/everest-clang-format/Dockerfile +++ b/docker/images/everest-clang-format/Dockerfile @@ -1,15 +1,4 @@ -ARG BASE_IMAGE=debian:12 -FROM ${BASE_IMAGE} - -RUN apt update && apt upgrade -y -RUN apt update && \ - apt install -y \ - clang-format-15=1:15.0.6* -RUN ln -s /usr/bin/clang-format-15 /usr/bin/clang-format - -RUN apt install -y \ - python-is-python3 - -COPY run-clang-format.py /usr/bin/run-clang-format +ARG BASE_IMAGE_TAG=latest +FROM ghcr.io/everest/everest-ci/build-env-base:${BASE_IMAGE_TAG} ENTRYPOINT ["/usr/bin/run-clang-format"] diff --git a/github-actions/run-clang-format/action.yaml b/github-actions/run-clang-format/action.yaml index 58ec5a2..5025362 100644 --- a/github-actions/run-clang-format/action.yaml +++ b/github-actions/run-clang-format/action.yaml @@ -19,7 +19,7 @@ inputs: default: 'always' runs: using: 'docker' - image: 'docker://ghcr.io/everest/everest-clang-format:v1.1.0' + image: 'docker://ghcr.io/everest/everest-ci/everest-clang-format:refactor-docker-images' # LTODO: Update this args: - /github/workspace/${{ inputs.source-dir }} - --extensions