|
| 1 | +name: clang-tidy-review |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - '**.h' |
| 7 | + - '**.cxx' |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pull-requests: write |
| 16 | + |
| 17 | +jobs: |
| 18 | + review: |
| 19 | + runs-on: ubuntu-24.04 |
| 20 | + steps: |
| 21 | + - name: Checkout PR branch |
| 22 | + uses: actions/checkout@v5 |
| 23 | + |
| 24 | + - name: Setup Python |
| 25 | + uses: actions/setup-python@v5 |
| 26 | + with: |
| 27 | + python-version: '3.11' |
| 28 | + |
| 29 | + - name: Install LLVM and Clang |
| 30 | + |
| 31 | + with: |
| 32 | + version: '20.1.4' |
| 33 | + |
| 34 | + - name: Install lit |
| 35 | + run: pip install --disable-pip-version-check --no-input lit |
| 36 | + |
| 37 | + - name: Install ROOT |
| 38 | + run: | |
| 39 | + ROOT_URL="https://root.cern/download/root_v6.34.06.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz" |
| 40 | + wget -O root.tar.gz "$ROOT_URL" |
| 41 | + sudo tar -xzf root.tar.gz -C /opt/ |
| 42 | + echo "/opt/root/bin" >> "$GITHUB_PATH" |
| 43 | +
|
| 44 | + - name: Run clang-tidy |
| 45 | + |
| 46 | + id: review |
| 47 | + with: |
| 48 | + build_dir: build |
| 49 | + apt_packages: cmake,libxml2,libxml2-dev,libtinfo-dev,zlib1g-dev,libzstd-dev,libvdt-dev,libtbb-dev |
| 50 | + split_workflow: true |
| 51 | + config_file: .clang-tidy |
| 52 | + cmake_command: > |
| 53 | + source /opt/root/bin/thisroot.sh && |
| 54 | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 55 | + -DCMAKE_C_COMPILER="$GITHUB_WORKSPACE/llvm/bin/clang" |
| 56 | + -DCMAKE_CXX_COMPILER="$GITHUB_WORKSPACE/llvm/bin/clang++" |
| 57 | + -DLLVM_DIR="$GITHUB_WORKSPACE/llvm" |
| 58 | + -DBUILD_SHARED_LIBS=ON |
| 59 | + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON |
| 60 | + -DRAMTOOLS_BUILD_TESTS=ON |
| 61 | + -DRAMTOOLS_BUILD_TOOLS=ON |
| 62 | + -DRAMTOOLS_BUILD_BENCHMARKS=ON && |
| 63 | + cd build && |
| 64 | + cmake --build . --target googletest --parallel $(nproc --all) |
| 65 | +
|
| 66 | + - name: Upload artifacts |
| 67 | + if: always() |
| 68 | + uses: ZedThree/clang-tidy-review/[email protected] |
| 69 | + |
0 commit comments