-
-
Notifications
You must be signed in to change notification settings - Fork 386
33 lines (30 loc) · 984 Bytes
/
iwyu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: IWYU
on:
workflow_call:
permissions: {}
jobs:
iwyu:
name: IWYU
runs-on: ubuntu-24.04
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install dependencies and iwyu
run: |
sudo apt-get -y update
sudo apt-get -y install libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev iwyu
- name: Prepare compile_commands.json
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_STRICT_COMPILATION=ON -DENABLE_IMAGE=ON -DENABLE_TOOLS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Analyze
run: |
iwyu_tool -p build -j "$(nproc)" -- -Xiwyu --cxx17ns -Xiwyu --error -Xiwyu --mapping_file="$GITHUB_WORKSPACE/iwyu.map" \
| (grep -E -v "^$|has correct #includes/fwd-decls" || true) | tee iwyu-result.txt
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: iwyu-result
path: iwyu-result.txt