Test tidy #4
Workflow file for this run
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
name: Static analysis | |
on: pull_request | |
jobs: | |
clang-tidy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Fetch base branch | |
run: | | |
git remote add upstream "https://github.com/${{ github.event.pull_request.base.repo.full_name }}" | |
git fetch --no-tags --no-recurse-submodules upstream "${{ github.event.pull_request.base.ref }}" | |
- name: Install clang-tidy | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang-tidy bear | |
- name: Configure Project | |
run: | | |
autoconf -i | |
aclocal -I scripts | |
autoheader | |
automake --add-missing | |
./configure | |
- name: Prepare compile_commands.json | |
run: | | |
bear -- make | |
- name: Create results directory | |
run: | | |
mkdir clang-tidy-result | |
- name: Analyze | |
run: | | |
git diff -U0 "$(git merge-base HEAD "upstream/${{ github.event.pull_request.base.ref }}")" | 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.sha }}" > clang-tidy-result/pr-head-sha.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: clang-tidy-result | |
path: clang-tidy-result/ |