Skip to content

Added architecture proposal files #197

Added architecture proposal files

Added architecture proposal files #197

Workflow file for this run

# yamllint disable rule:line-length
---
name: Clang-Tidy
on: # yamllint disable-line rule:truthy
pull_request:
branches: ['*']
jobs:
clang-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
uses: jitterbit/get-changed-files@v1
id: changed_files
with:
format: space-delimited
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Clang-Tidy
run: |-
IFS=' ' read -r -a files <<< "${{ steps.changed_files.outputs.all }}"
cpp_files=()
for file in "${files[@]}"; do
if [[ "$file" == *.cpp || "$file" == *.h || "$file" == *.hpp || "$file" == *.cc || "$file" == *.cxx || "$file" == *.hxx ]]; then
cpp_files+=("$file")
fi
done
if [ ${#cpp_files[@]} -gt 0 ]; then
echo -e "Running clang-tidy"
bazel build //... \
--aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect \
--output_groups=report \
--@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
else
echo -e "Skipping clang-tidy since no source files were changed."
fi
- name: Show failure message
if: failure()
run: |-
echo -e "To automatically apply suggested fixes, run the following command:
======================================================================================
1. Generate compile commands:
bazel run @hedron_compile_commands//:refresh_all
2. Run clang-tidy:
find . -name \"*.cpp\" -o -name \"*.h\" -o -name \"*.hpp\" -o -name \"*.cc\" -o -name \"*.cxx\" -o -name \"*.hxx\" | xargs clang-tidy -fix -fix-errors -p ./compile_commands.json
======================================================================================"