fix: try to fix ci workflow test error (#65) #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'Dockerfile*' | |
- 'docker-bake.hcl' | |
- '**.yml' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'Dockerfile*' | |
- 'docker-bake.hcl' | |
- '**.yml' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Check formatting | |
run: make install-deps && make lint | |
- name: Login container registries | |
run: | | |
echo $CR_PAT | docker login ghcr.io -u shenxianpeng --password-stdin | |
docker login -u '${{ secrets.DOCKER_USERNAME }}' -p '${{ secrets.DOCKER_PASSWORD }}' | |
env: | |
CR_PAT: ${{ secrets.CR_PAT }} | |
- name: Check buildx bake | |
run: docker buildx bake --file docker-bake.hcl --print | |
- name: Build all images | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: docker buildx bake --file docker-bake.hcl --load | |
- name: Test all images | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
echo "start to test clang-tools images" | |
docker images | |
clang_versions="17 16 15 14 13 12 11 10 9" | |
for clang_version in ${clang_versions}; do | |
echo "testing clang_version $clang_version" | |
docker run ghcr.io/cpp-linter/clang-tools:all clang-format-$clang_version --version | grep -E "clang-format version $clang_version" | |
docker run ghcr.io/cpp-linter/clang-tools:all clang-tidy-$clang_version --version | grep "LLVM version $clang_version" | |
done | |
all_tags="17 16 15 14 13 12 11 10 9 8 7" | |
for tag in ${all_tags}; do | |
echo "testing clang-tools:tag" | |
docker run ghcr.io/cpp-linter/clang-tools:$tag clang-format --version | grep -E "clang-format version $tag" | |
docker run ghcr.io/cpp-linter/clang-tools:$tag clang-tidy --version | grep "LLVM version $tag" | |
done | |
echo "testing clang-tools:16-alpine" | |
docker run ghcr.io/cpp-linter/clang-tools:16-alpine clang-format --version | grep -E "clang-format version" | |
docker run ghcr.io/cpp-linter/clang-tools:16-alpine clang-tidy --version | grep "LLVM version" | |
- name: Publish all images | |
if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' | |
run: docker buildx bake --file docker-bake.hcl --push |