toolchain: update include directories in aarch64 #244
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yamllint disable rule:line-length | |
--- | |
name: Clang | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: ['*'] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
container: | |
image: dtors/base-cpp:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Configure Git Safe Directory | |
run: | | |
git config --global --add safe.directory $(pwd) | |
- name: Find affected files | |
run: | | |
git fetch origin ${{ github.base_ref }} --depth=1 | |
git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt | |
echo "Affected files:" | |
cat affected_files.txt | |
- name: Find affected cpp files | |
run: | | |
> affected_cpp_files.txt | |
while read file; do | |
if [[ "$file" == *.c || "$file" == *.cc || "$file" == *.cpp || "$file" == *.cxx || "$file" == *.h || "$file" == *.hpp || "$file" == *.hxx ]]; then | |
echo "$file" >> affected_cpp_files.txt | |
fi | |
done < affected_files.txt | |
sort -u affected_cpp_files.txt -o affected_cpp_files.txt | |
echo "Affected cpp files:" | |
cat affected_cpp_files.txt | |
echo "cpp_files=$(cat affected_cpp_files.txt | tr '\n' ' ')" >> $GITHUB_ENV | |
shell: bash | |
- name: Run Clang-Format | |
if: env.cpp_files != '' | |
run: | | |
echo "Running: clang-format --dry-run --Werror ${cpp_files}" | |
clang-format --dry-run --Werror ${cpp_files} | |
- name: Skip Clang-Format | |
if: env.cpp_files == '' | |
run: echo "No affected cpp files found. Skipping Clang-Format." | |
- name: Show failure message | |
if: failure() | |
run: |- | |
echo -e "To automatically apply suggested fixes, run the following command: | |
====================================================================================== | |
1. Run clang-format: | |
find . -iname \"*.c\" -o -iname \"*.cc\" -o -iname \"*.cpp\" -o -iname \"*.cxx\" -o -iname \"*.h\" -o -iname \"*.hpp\" -o -iname \"*.hxx\" | xargs clang-format -i | |
======================================================================================" |