Skip to content

Update include-what-you-use.yml #17

Update include-what-you-use.yml

Update include-what-you-use.yml #17

on:
pull_request:
push:
branches:
- iwyu # TODO: remove
jobs:
include-what-you-use:
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 -D=CMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-Xiwyu;--no_default_mapping;-Xiwyu;--mapping_file=$PWD/include-what-you-use.imp"
- name: Collect include-what-you-use recommendations
run: set -o pipefail; iwyu_tool -j 4 -p build -- --no_default_mapping --mapping_file=$PWD/include-what-you-use.imp | tee build/build-log.txt
- name: Apply include-what-you-use recommendations
run: fix_include --nosafe_headers --ignore_re '' < build/build-log.txt