Skip to content

handle repeated use of @rules_clang_tidy//:extra-options #72

handle repeated use of @rules_clang_tidy//:extra-options

handle repeated use of @rules_clang_tidy//:extra-options #72

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-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- bazel: latest
compiler: clang-18
- bazel: latest
compiler: clang-17
- bazel: latest
compiler: clang-16
- bazel: latest
compiler: clang-15
- bazel: latest
compiler: clang-14
- bazel: 7.x
compiler: clang-18
- bazel: 6.x
compiler: clang-18
- bazel: 5.x
compiler: clang-18
steps:
- name: install ${{ matrix.compiler }}
shell: bash
run: |
set -x
version=$(echo ${{ matrix.compiler }} | cut -d'-' -f2)
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $version
sudo apt-get install -y clang-tidy-$version libc++-$version-dev
sudo ln -sf $(which clang-tidy-$version) /usr/bin/clang-tidy
clang-tidy-$version --version
- uses: actions/checkout@v4
- name: run clang-tidy
shell: bash
env:
USE_BAZEL_VERION: ${{ matrix.bazel }}
CC: ${{ matrix.compiler }}
run: |
set -x
cd 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: .*misc-unused-alias-decls" log
check-tidy-extra-options:
runs-on: ubuntu-latest
steps:
- name: install clang-tidy
shell: bash
run: |
set -x
version=18
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $version
sudo apt-get install -y clang-tidy-$version libc++-$version-dev
sudo ln -sf $(which clang-tidy-$version) /usr/bin/clang-tidy
clang-tidy-$version --version
- uses: actions/checkout@v4
- name: run clang-tidy
shell: bash
env:
CC: clang-18
run: |
set -x
cd example
bazel build \
--announce_rc \
--config=clang-tidy \
--color=yes \
--@rules_clang_tidy//:extra-options=--enable-check-profile \
--@rules_clang_tidy//:extra-options=--checks='fuchsia-*' \
//... 2>&1 | tee log || true
grep "clang-tidy checks profiling" log
grep "error: .*misc-unused-alias-decls" log
grep "error: .*fuchsia-trailing-return" log
all:
runs-on: ubuntu-latest
if: ${{ github.base_ref == 'main' }}
needs:
- buildifier
- check-tidy-matrix
- check-tidy-extra-options
steps:
- run: true