Skip to content

Commit

Permalink
Introduce clang-tidy review
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurBandaryk committed Feb 2, 2022
1 parent 368b3f6 commit 763aad4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/clang_tidy_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow for doing review based on clang-tidy.
name: Code review with clang-tidy

on:
push:
branches:
- "main"
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"

jobs:
clang_tidy_checks:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# For now we run clang-tidy checks for macOS and Ubuntu.
# Later we will run clang-tidy checks for Windows too.
os: ["macos-latest", "ubuntu-latest"]

steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Generate compile_commands.json
run: |
chmod +x dev-tools/clang-tidy-review/generate_compilation_database.sh
dev-tools/clang-tidy-review/generate_compilation_database.sh
- name: Install clang-tidy on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y clang-tidy-12
sudo ln -s $(which clang-tidy-12) /usr/bin/clang-tidy
- name: Create clang-tidy symlink on macOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
clang-tidy --version
- name: Run clang-tidy checks
run: |
chmod +x dev-tools/clang-tidy-review/clang_tidy_review.sh
dev-tools/clang-tidy-review/clang_tidy_review.sh
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "dev-tools"]
path = dev-tools
url = https://github.com/3rdparty/dev-tools.git
branch = ArthurBandaryk.generate-compilation-database
2 changes: 1 addition & 1 deletion dev-tools

0 comments on commit 763aad4

Please sign in to comment.