Skip to content

Create build-test-publish.yml #23

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 10 commits into from
Mar 27, 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
42 changes: 42 additions & 0 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & Test & Publish

on:
push:
branches: [ master ]
paths:
- '**Dockerfile'
pull_request:
branches: [ master ]
paths:
- '**Dockerfile'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
- name: build-test-publish
run: |
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
make build FILE=$file
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
docker run clang-tools:$tag clang-tidy-$version --version | grep "LLVM version $version"
done
else
docker run clang-tools:$tag clang-format --version | grep -E clang-format.*$tag
docker run clang-tools:$tag clang-tidy --version | grep "LLVM version $tag"
fi
docker tag clang-tools:$tag xianpengshen/clang-tools:$tag
docker push xianpengshen/clang-tools:$tag
fi
done
5 changes: 2 additions & 3 deletions 12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ FROM ubuntu:20.04

ENV VERSION 12

RUN tools="clang-format-$VERSION clang-tidy-$VERSION" \
&& apt-get update \
&& apt-get -y install $tools \
RUN apt-get update \
&& apt-get -y install clang-format-$VERSION clang-tidy-$VERSION \
&& rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/clang-format-"$VERSION" /usr/bin/clang-format \
Expand Down