Update include-what-you-use.yml #20
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
on: | |
pull_request: | |
paths: | |
- '**.h' | |
- '**.cpp' | |
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 | |
- 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/include-what-you-use.imp | tee build/build-log.txt | |
- name: Apply include-what-you-use recommendations | |
run: fix_include --nosafe_headers --ignore_re '/lib/' < build/build-log.txt | |
- run: git diff > build/include-what-you-use-diff.txt | |
- name: Upload the diff | |
uses: actions/upload-artifact@v4 | |
with: | |
name: include-what-you-use-diff | |
path: build/include-what-you-use-diff.txt |