IWYU #52
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: IWYU | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 12 * * 0" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
iwyu_ubuntu_2204: | |
runs-on: ubuntu-latest | |
container: ghcr.io/acts-project/ubuntu2204_clang:v41 | |
steps: | |
- name: Install git lfs and llvm dev | |
run: apt-get update && apt-get install -y git-lfs llvm-dev libclang-dev clang | |
- name: Get IWYU source | |
uses: actions/checkout@v4 | |
with: | |
repository: include-what-you-use/include-what-you-use | |
ref: clang_14 | |
path: iwyu | |
- name: Build IWYU | |
run: > | |
mkdir iwyu-build iwyu-install && | |
cmake -B iwyu-build -S iwyu | |
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 | |
-DCMAKE_INSTALL_PREFIX=iwyu-install && | |
cmake --build iwyu-build --target install | |
- name: Get Acts source | |
uses: actions/checkout@v4 | |
with: | |
path: acts | |
submodules: true | |
lfs: true | |
- name: Configure Acts | |
run: > | |
mkdir acts-build acts-install && | |
cmake -B acts-build -S acts | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_CXX_FLAGS=-Werror | |
-DCMAKE_CXX_STANDARD=17 | |
-DCMAKE_INSTALL_PREFIX=acts-install | |
-DACTS_BUILD_EVERYTHING=ON | |
-DACTS_BUILD_ODD=ON | |
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON | |
-DACTS_BUILD_EXAMPLES_EDM4HEP=ON | |
- name: Run IWYU | |
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- -Xiwyu --mapping_file=$(pwd)/acts/CI/iwyu/mapping.imp | tee iwyu-output.txt | |
- name: Filter IWYU output | |
run: python3 acts/CI/iwyu/filter.py acts/CI/iwyu/filter.yaml iwyu-output.txt iwyu-filtered.txt | |
- name: Apply IWYU | |
run: python3 iwyu-install/bin/fix_includes.py < iwyu-filtered.txt | |
- name: Upload IWYU output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: iwyu | |
path: | | |
iwyu-output.txt | |
iwyu-filtered.txt |