Skip to content

add github check workflow #22

add github check workflow

add github check workflow #22

Workflow file for this run

name: check
on:
push:
branches: [ main ]
pull_request:
branches: [ "*" ]
types: [synchronize, opened, reopened, edited]
workflow_dispatch:
jobs:
buildifier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- shell: bash
run: |
bazel run //tools:buildifier.check
check-tidy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bazel:
#- latest
- 7.x
#- 6.x
#- 5.x
compiler:
- clang-18
#- clang-17
#- clang-16
#- clang-15
#- clang-14
example:
- misc-unused-alias-decls
steps:
- name: install ${{ matrix.compiler }}
shell: bash
run: |
version=$(echo ${{ matrix.compiler }} | cut -d'-' -f2)
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $version
sudo ln -sf $(which clang-tidy-$version) /usr/bin/clang-tidy
clang-tidy --version
clang-tidy-$version --version
ls -al /usr/bin
- uses: actions/checkout@v4
- name: run clang-tidy
shell: bash
env:
USE_BAZEL_VERION: ${{ matrix.bazel }}
CC: ${{ matrix.compiler }}
run: |
cd example/${{ matrix.example }}
if [[ "${{ matrix.bazel }}" < 6 ]]; then
sed -i '/enable_bzlmod/d' .bazelrc
fi
bazel build --announce_rc --config=clang-tidy --color=yes //... | tee log || true
grep "error: .*${{ matrix.example }}" log
all:
runs-on: ubuntu-latest
if: ${{ github.base_ref == 'main' }}
needs:
- buildifier
- check-tidy
steps:
- run: true