Skip to content

IWYU: phase 1

IWYU: phase 1 #42

on: [push, pull_request]
jobs:
include-what-you-use:
if: false
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: sudo apt-get install iwyu build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libphysfs-dev gettext git po4a vorbis-tools libglm-dev
- name: Download the code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Genarate a compilation database
run: cmake -S . -B build -D=CMAKE_EXPORT_COMPILE_COMMANDS=ON -D=TESTS=ON
- name: Generate iwyu mappings for C++
run: .github/workflows/include-what-you-use/c-to-cpp.py /usr/share/include-what-you-use ./build
- name: Collect include-what-you-use recommendations
run: |
set -o pipefail;
iwyu_tool \
-j 4 \
-p build \
-- \
-Xiwyu --no_default_mapping \
-Xiwyu --mapping_file=$PWD/build/iwyu.gcc.imp \
-Xiwyu --mapping_file=$PWD/.github/workflows/include-what-you-use/dependencies.imp \
| tee build/iwyu-log.txt
- name: Apply include-what-you-use recommendations
run: fix_include --safe_headers --noreorder --ignore_re '/lib/' < build/iwyu-log.txt
- name: Check whether there are any changes
run: git diff --exit-code