[feat] add linter ci #5
Workflow file for this run
This file contains hidden or 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: Lint | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Python linter | |
| run: pip install ruff==0.4.4 | |
| - name: Run Python linter | |
| run: ruff check . | |
| - name: Install clang-tidy | |
| run: sudo apt-get update && sudo apt-get install -y clang-tidy | |
| - name: Run clang-tidy on C++ files | |
| run: | | |
| find . -type f \( -name '*.cpp' -o -name '*.cc' -o -name '*.h' \) \ | |
| -exec clang-tidy {} -- -std=c++17 \; | |
| - name: Run clang-format on C++ files | |
| run: | | |
| find . -type f \( -name '*.cpp' -o -name '*.cc' -o -name '*.h' \) \ | |
| -exec clang-format -i {} \; |