fix linting #56
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: clang-tidy | |
on: | |
push: | |
pull_request: | |
types: [ opened, reopened, synchronize ] | |
jobs: | |
clang-tidy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: [Release] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install dependencies | |
uses: ./.github/workflows/actions/ubuntu-build-deps | |
with: | |
SUDO: true | |
- name: Configure | |
run: | | |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_EXPORT_COMPILE_COMMANDS=true | |
- name: Compile | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} | |
# Implicitly requires build/compile_commands.json to exist | |
- name: Run Clang Tidy | |
run: | | |
wget https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-14.0.6/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | |
chmod +x run-clang-tidy.py | |
./run-clang-tidy.py -j $(nproc) -p build | |
# Implicitly requires build/compile_commands.json to exist | |
- name: Run IWYU | |
run: | | |
wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/clang_14/iwyu_tool.py | |
chmod +x iwyu_tool.py | |
# iwyu_tool.py returns non-zero if any executions returned nonzero. Which... happens to be useless unless the project is already IWYU clean. | |
./iwyu_tool.py -j $(nproc) -p build -- -Xiwyu --mapping_file=${GITHUB_WORKSPACE}/iwyu-ubuntu.imp || exit 0 |