add clang-format-14
This commit is contained in:
25
.github/workflows/ghcr-push.yml
vendored
25
.github/workflows/ghcr-push.yml
vendored
@@ -32,6 +32,31 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build -f clang-format-16.dockerfile -t "$SLUG:latest" -t "$SLUG:$DATE" .
|
docker build -f clang-format-16.dockerfile -t "$SLUG:latest" -t "$SLUG:$DATE" .
|
||||||
|
|
||||||
|
- name: Publish to GHCR
|
||||||
|
run: |
|
||||||
|
echo '${{secrets.GHCR_TOKEN}}' | docker login ghcr.io -u cwpearson --password-stdin
|
||||||
|
docker push "$SLUG:latest"
|
||||||
|
docker push "$SLUG:$DATE"
|
||||||
|
build-14:
|
||||||
|
name: Build + Publish 14
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
name: Checkout
|
||||||
|
|
||||||
|
- name: Set Environment
|
||||||
|
run: |
|
||||||
|
echo "SLUG=ghcr.io/cwpearson/clang-format-14" >> $GITHUB_ENV
|
||||||
|
echo "DATE=$(date +"%Y%m%d")" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
docker build -f clang-format-14.dockerfile -t "$SLUG:latest" -t "$SLUG:$DATE" .
|
||||||
|
|
||||||
- name: Publish to GHCR
|
- name: Publish to GHCR
|
||||||
run: |
|
run: |
|
||||||
echo '${{secrets.GHCR_TOKEN}}' | docker login ghcr.io -u cwpearson --password-stdin
|
echo '${{secrets.GHCR_TOKEN}}' | docker login ghcr.io -u cwpearson --password-stdin
|
||||||
|
44
clang-format-14.dockerfile
Normal file
44
clang-format-14.dockerfile
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Stage 1: Build environment
|
||||||
|
FROM docker.io/redhat/ubi8 AS builder
|
||||||
|
|
||||||
|
RUN dnf install -y \
|
||||||
|
cmake \
|
||||||
|
gcc \
|
||||||
|
gcc-c++ \
|
||||||
|
python3 \
|
||||||
|
wget \
|
||||||
|
xz \
|
||||||
|
&& dnf clean all
|
||||||
|
|
||||||
|
RUN wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-project-14.0.6.src.tar.xz \
|
||||||
|
&& tar -xf llvm-project-14.0.6.src.tar.xz
|
||||||
|
RUN cmake -S llvm-project-14.0.6.src/llvm -B build \
|
||||||
|
-DLLVM_ENABLE_PROJECTS='clang' \
|
||||||
|
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||||
|
-DLLVM_TARGETS_TO_BUILD=""
|
||||||
|
RUN make -C build -j$(nproc) install
|
||||||
|
|
||||||
|
# base final image off ubi8-micro
|
||||||
|
FROM docker.io/redhat/ubi8-micro
|
||||||
|
|
||||||
|
LABEL maintainer="Carl Pearson <me@carlpearson.net>"
|
||||||
|
LABEL org.opencontainers.image.title="clang-format 14"
|
||||||
|
LABEL description="A container with clang-format 14"
|
||||||
|
LABEL org.opencontainers.image.description="A container with clang-format 14"
|
||||||
|
LABEL org.opencontainers.image.source https://github.com/cwpearson/clang-format
|
||||||
|
LABEL org.opencontainers.image.licenses="MIT"
|
||||||
|
# LABEL version="1.0"
|
||||||
|
# LABEL org.opencontainers.image.version="1.0"
|
||||||
|
# LABEL org.opencontainers.image.url="https://example.com"
|
||||||
|
# LABEL org.opencontainers.image.documentation="https://example.com/docs"
|
||||||
|
# LABEL org.opencontainers.image.vendor="Example Corp"
|
||||||
|
|
||||||
|
# clang-format-14 links this
|
||||||
|
COPY --from=builder /lib64/libstdc++.so.6 /lib64/libstdc++.so.6
|
||||||
|
# keep clang-format binary only
|
||||||
|
COPY --from=builder /usr/local/bin/clang-format /usr/local/bin/clang-format
|
||||||
|
# also provide clang-format-14
|
||||||
|
RUN ln -s /usr/local/bin/clang-format /usr/local/bin/clang-format-14
|
||||||
|
|
||||||
|
# expect caller to map $PWD into /src with -v flag
|
||||||
|
WORKDIR /src
|
Reference in New Issue
Block a user