Skip to content

Bump ubuntu from 20.04 to 22.04 in /12 #65

Bump ubuntu from 20.04 to 22.04 in /12

Bump ubuntu from 20.04 to 22.04 in /12 #65

name: CI
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/changed-files@v18.4
- name: Build & Test (Publish)
run: |
pip install pre-commit && pre-commit install
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
echo "start to build ..."
make prune
make build FILE=$file
docker images
echo "start to test ..."
tag=`dirname $file`
if [ $tag == "all" ]; then
clang_versions="16 15 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"
docker run clang-tools:$tag clang-tidy --version | grep "LLVM version"
else
docker run clang-tools:$tag clang-format --version | grep -E "clang-format version $tag"
docker run clang-tools:$tag clang-tidy --version | grep "LLVM version $tag"
fi
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
echo "start to publish ..."
make publish FILE=$file
fi
fi
done