Update clang-format.yml

This commit is contained in:
xiaoyifang 2022-02-10 20:29:50 +08:00 committed by GitHub
parent f6f0e25674
commit b382a02ab0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,8 +24,7 @@ jobs:
strategy:
matrix:
path:
- check: '.'
exclude: '(winlibs|maclibs)' # Exclude file paths containing "hello" or "world"
- exclude: 'winlibs|maclibs' # Exclude file paths containing "hello" or "world"
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++/Protobuf programs.
@ -35,32 +34,7 @@ jobs:
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
fallback-style: 'llvm' # optional
clang-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy
- name: Prepare compile_commands.json
run: |
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Create results directory
run: |
mkdir clang-tidy-result
- name: Analyze
run: |
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml
- name: Save PR metadata
run: |
echo ${{ github.event.number }} > clang-tidy-result/pr-id.txt
echo ${{ github.event.pull_request.head.repo.full_name }} > clang-tidy-result/pr-head-repo.txt
echo ${{ github.event.pull_request.head.ref }} > clang-tidy-result/pr-head-ref.txt
- uses: actions/upload-artifact@v2
with:
name: clang-tidy-result
path: clang-tidy-result/
clang-format-checking:
runs-on: ubuntu-latest
steps: