diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index a70d2641cb57f3..5f0e1e21513ce1 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -38,6 +38,36 @@ jobs: level: warning fail_on_error: true + clang-format: + runs-on: ubuntu-22.04 + if: ${{ github.repository_owner == 'openvinotoolkit' }} + permissions: + pull-requests: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: 'true' + + - name: Install clang-format-15 + run: | + sudo apt update + sudo apt --assume-yes install clang-format-15 + + # Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector + - name: CMake configure + run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/clang-aarch64.toolchain.cmake -B build_aarch64 + + - name: Create code style diff + run: cmake --build build_aarch64 --target clang_format_fix_all -j8 + + - name: suggester / clang-format + if: startsWith(github.event_name, 'pull_request') + uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3 # v1.18.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + level: warning + fail_on_error: true + ShellCheck: runs-on: ubuntu-22.04 if: ${{ github.repository_owner == 'openvinotoolkit' }} diff --git a/cmake/clang-aarch64.toolchain.cmake b/cmake/clang-aarch64.toolchain.cmake new file mode 100644 index 00000000000000..bfea574265ebe8 --- /dev/null +++ b/cmake/clang-aarch64.toolchain.cmake @@ -0,0 +1,14 @@ +# Copyright (C) 2018-2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR aarch64) + +set(CMAKE_C_COMPILER clang-15) +set(CMAKE_CXX_COMPILER clang++-15) +set(CMAKE_LINKER lld) + +set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu) +#set(CMAKE_SYSROOT /usr/aarch64-linux-gnu) +# set(PKG_CONFIG_EXECUTABLE aarch64-linux-gnu-pkg-config CACHE PATH "Path to ARM64 pkg-config")