Skip to content

Change ENV variable to CLANG_VERSIONS #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: tj-actions/[email protected]
- name: Build & Test (Publish)
run: |
docker login -u=${{ secrets.DOCKER_USERNAME }} -p=${{ secrets.DOCKER_PASSWORD }}
docker login -u '${{ secrets.DOCKER_USERNAME }}' -p '${{ secrets.DOCKER_PASSWORD }}'
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ "$file" == *"Dockerfile" ]]; then
set -e
Expand All @@ -32,10 +32,10 @@ jobs:
echo "start to test ..."
tag=`dirname $file`
if [ $tag == "all" ]; then
versions="14 13 12 11 10 9 8"
for version in ${versions}; do
docker run clang-tools:$tag clang-format-$version --version | grep -E "clang-format version $version"
docker run clang-tools:$tag clang-tidy-$version --version | grep "LLVM version $version"
clang_versions="14 13 12 11 10 9 8"
for clang_version in ${clang_versions}; do
docker run clang-tools:$tag clang-format-$clang_version --version | grep -E "clang-format version $clang_version"
docker run clang-tools:$tag clang-tidy-$clang_version --version | grep "LLVM version $clang_version"
done
elif [[ "$tag" == *"alpine"* ]]; then
docker run clang-tools:$tag clang-format --version | grep -E "clang-format version"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/snyk-container-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@ jobs:
with:
image: xianpengshen/clang-tools:all
args: --severity-threshold=high --file=all/Dockerfile
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif
8 changes: 4 additions & 4 deletions 10/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 10
ENV CLANG_VERSION 10

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 11
ENV CLANG_VERSION 11

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 12
ENV CLANG_VERSION 12

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 13/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM ubuntu:20.04

ENV VERSION 13
ENV CLANG_VERSION 13

RUN mv /etc/apt/sources.list /etc/apt/sources.list.focal

COPY sources.list.jammy /etc/apt/sources.list

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& mv /etc/apt/sources.list.focal /etc/apt/sources.list \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 14/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM ubuntu:20.04

ENV VERSION 14
ENV CLANG_VERSION 14

RUN mv /etc/apt/sources.list /etc/apt/sources.list.focal

COPY sources.list.jammy /etc/apt/sources.list

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& mv /etc/apt/sources.list.focal /etc/apt/sources.list \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 6.0
ENV CLANG_VERSION 6.0

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 7
ENV CLANG_VERSION 7

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 8
ENV CLANG_VERSION 8

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
8 changes: 4 additions & 4 deletions 9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04

ENV VERSION 9
ENV CLANG_VERSION 9

RUN apt-get update \
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
&& echo "--- Clang-format version ---" \
&& clang-format --version \
&& echo "--- Clang-tidy version ---" \
Expand Down
12 changes: 6 additions & 6 deletions all/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ FROM ubuntu:20.04

ARG DEFAULT_VERSION=12

ENV VERSIONS="12 11 10 9 8"
ENV CLANG_VERSIONS="12 11 10 9 8"

RUN apt-get update \
&& for VERSION in ${VERSIONS}; do \
apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION; done \
&& for CLANG_VERSION in ${CLANG_VERSIONS}; do \
apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION; done \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/clang-format-$DEFAULT_VERSION /usr/bin/clang-format \
&& ln -s /usr/bin/clang-tidy-$DEFAULT_VERSION /usr/bin/clang-tidy \
&& mv /etc/apt/sources.list /etc/apt/sources.list.focal

ENV VERSIONS="14 13"
ENV CLANG_VERSIONS="14 13"

# clang 13, 14 packages exist in jammy
COPY sources.list.jammy /etc/apt/sources.list

RUN apt-get update \
&& for VERSION in ${VERSIONS}; do \
apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION; done \
&& for CLANG_VERSION in ${CLANG_VERSIONS}; do \
apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION; done \
&& mv /etc/apt/sources.list.focal /etc/apt/sources.list \
&& rm -rf /var/lib/apt/lists/* \
&& echo "--- Clang-format version ---" \
Expand Down