Skip to content

Gemm ELF test fix for Linux #104

Gemm ELF test fix for Linux

Gemm ELF test fix for Linux #104

# SPDX-License-Identifier: MIT
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
name: clang-tidy-review
on:
pull_request:
types: [opened, synchronize, reopened]
branches: master
workflow_dispatch:
jobs:
clangtidy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# Dependencies needed for external cmake configuration
- name: Install dependencies
run: |
sudo apt update
sudo src/runtime_src/tools/scripts/xrtdeps.sh
- name: Configure legacy XRT build
run: |
cmake -B build/legacy \
-DXRT_ENABLE_HIP=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release src
- name: Configure edge XRT
run: |
env XRT_NATIVE_BUILD=no cmake -B build/edge \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release src
- name: Configure NPU XRT
run: |
cmake -B build/npu \
-DXRT_NPU=1 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release src
- name: Merge databases into one compile_commands.json
run: |
python <<EOF
import json, os
# Last entry is preserved
build_dirs = ["build/npu", "build/edge", "build/legacy"]
merged_commands = {}
for build_dir in build_dirs:
json_path = os.path.join(build_dir, "compile_commands.json")
if os.path.exists(json_path):
with open(json_path, "r") as f:
commands = json.load(f)
for entry in commands:
merged_commands[entry["file"]] = entry
with open("compile_commands.json", "w") as f:
json.dump(list(merged_commands.values()), f, indent=2)
print("Merged compile_commands.json created.")
EOF
- name: Upload merged database
uses: actions/upload-artifact@v4
with:
name: compile_commands
path: compile_commands.json
# Review uses external combined database
- name: Create clang-tidy review
id: review
uses: stsoe/clang-tidy-review@patches
with:
apt_packages: |
cmake, g++, pkg-config, libdrm-dev,
ocl-icd-dev, ocl-icd-libopencl1, ocl-icd-opencl-dev,
libamdhip64-dev,
libboost-dev, libboost-filesystem-dev, libboost-program-options-dev,
libncurses5-dev,
libssl-dev,
rapidjson-dev,
libelf-dev,
libprotoc-dev, protobuf-compiler,
uuid-dev,
systemtap-sdt-dev,
curl, libcurl4-openssl-dev,
libudev-dev
# disable default checks and rely on closest .clangtidy
clang_tidy_checks: ''
split_workflow: true
- name: Upload clang-tidy review
uses: stsoe/clang-tidy-review/upload@patches
id: upload-review