name: profiler-hub Formatting run-name: profiler-hub-formatting on: workflow_dispatch: push: branches: - develop paths: - '.github/workflows/profiler-hub-formatting.yml' - 'profilers/profiler-hub/**' - '!profilers/profiler-hub/build/**' - '!profilers/profiler-hub/docs/graphs/**' pull_request: paths: - '.github/workflows/profiler-hub-formatting.yml' - 'profilers/profiler-hub/**' - '!profilers/profiler-hub/build/**' - '!profilers/profiler-hub/docs/graphs/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: clang-format: name: C/C++ Formatting (clang-format-18) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 with: sparse-checkout: | profilers/profiler-hub .github/workflows - name: Install clang-format-18 run: | sudo apt-get update sudo apt-get install -y clang-format-18 - name: Run clang-format working-directory: profilers/profiler-hub run: | set -e mapfile -t FILES < <(find source include tests -type f \ \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.cc' \)) echo "Checking ${#FILES[@]} files" OUT=$(clang-format-18 -output-replacements-xml "${FILES[@]}") REPLACEMENTS=$(echo "${OUT}" | grep -c '