Skip to content

Commit 6fd262d

Browse files
authored
Change ENV variable to CLANG_VERSIONS (#31)
* Change ENV variable to CLANG_VERSIONS * Fix CodeQL scanning * Change Eariable to Cclang_versions * Fix CI workflow failure
1 parent c864e94 commit 6fd262d

File tree

12 files changed

+47
-51
lines changed

12 files changed

+47
-51
lines changed

.github/workflows/build-test-publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: tj-actions/[email protected]
2121
- name: Build & Test (Publish)
2222
run: |
23-
docker login -u=${{ secrets.DOCKER_USERNAME }} -p=${{ secrets.DOCKER_PASSWORD }}
23+
docker login -u '${{ secrets.DOCKER_USERNAME }}' -p '${{ secrets.DOCKER_PASSWORD }}'
2424
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
2525
if [[ "$file" == *"Dockerfile" ]]; then
2626
set -e
@@ -32,10 +32,10 @@ jobs:
3232
echo "start to test ..."
3333
tag=`dirname $file`
3434
if [ $tag == "all" ]; then
35-
versions="14 13 12 11 10 9 8"
36-
for version in ${versions}; do
37-
docker run clang-tools:$tag clang-format-$version --version | grep -E "clang-format version $version"
38-
docker run clang-tools:$tag clang-tidy-$version --version | grep "LLVM version $version"
35+
clang_versions="14 13 12 11 10 9 8"
36+
for clang_version in ${clang_versions}; do
37+
docker run clang-tools:$tag clang-format-$clang_version --version | grep -E "clang-format version $clang_version"
38+
docker run clang-tools:$tag clang-tidy-$clang_version --version | grep "LLVM version $clang_version"
3939
done
4040
elif [[ "$tag" == *"alpine"* ]]; then
4141
docker run clang-tools:$tag clang-format --version | grep -E "clang-format version"

.github/workflows/snyk-container-analysis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ jobs:
3434
with:
3535
image: xianpengshen/clang-tools:all
3636
args: --severity-threshold=high --file=all/Dockerfile
37-
- name: Upload result to GitHub Code Scanning
38-
uses: github/codeql-action/upload-sarif@v1
39-
with:
40-
sarif_file: snyk.sarif

10/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 10
3+
ENV CLANG_VERSION 10
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

11/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 11
3+
ENV CLANG_VERSION 11
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

12/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 12
3+
ENV CLANG_VERSION 12
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

13/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 13
3+
ENV CLANG_VERSION 13
44

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

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

99
RUN apt-get update \
10-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
10+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
1111
&& mv /etc/apt/sources.list.focal /etc/apt/sources.list \
12-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
13-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
12+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
13+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
1414
&& echo "--- Clang-format version ---" \
1515
&& clang-format --version \
1616
&& echo "--- Clang-tidy version ---" \

14/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 14
3+
ENV CLANG_VERSION 14
44

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

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

99
RUN apt-get update \
10-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
10+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
1111
&& mv /etc/apt/sources.list.focal /etc/apt/sources.list \
12-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
13-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
12+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
13+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
1414
&& echo "--- Clang-format version ---" \
1515
&& clang-format --version \
1616
&& echo "--- Clang-tidy version ---" \

6/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 6.0
3+
ENV CLANG_VERSION 6.0
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

7/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 7
3+
ENV CLANG_VERSION 7
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

8/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 8
3+
ENV CLANG_VERSION 8
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

9/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:20.04
22

3-
ENV VERSION 9
3+
ENV CLANG_VERSION 9
44

55
RUN apt-get update \
6-
&& apt-get --no-install-recommends -y install clang-format-$VERSION clang-tidy-$VERSION \
7-
&& ln -s /usr/bin/clang-format-$VERSION /usr/bin/clang-format \
8-
&& ln -s /usr/bin/clang-tidy-$VERSION /usr/bin/clang-tidy \
6+
&& apt-get --no-install-recommends -y install clang-format-$CLANG_VERSION clang-tidy-$CLANG_VERSION \
7+
&& ln -s /usr/bin/clang-format-$CLANG_VERSION /usr/bin/clang-format \
8+
&& ln -s /usr/bin/clang-tidy-$CLANG_VERSION /usr/bin/clang-tidy \
99
&& echo "--- Clang-format version ---" \
1010
&& clang-format --version \
1111
&& echo "--- Clang-tidy version ---" \

all/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ FROM ubuntu:20.04
22

33
ARG DEFAULT_VERSION=12
44

5-
ENV VERSIONS="12 11 10 9 8"
5+
ENV CLANG_VERSIONS="12 11 10 9 8"
66

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

15-
ENV VERSIONS="14 13"
15+
ENV CLANG_VERSIONS="14 13"
1616

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

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

0 commit comments

Comments
 (0)