cleaned up includes based on include-what-you-use / iwyu.yml: updated to yet another distro to get the latest version and updated the Chaotic-AUR key #88
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
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | |
name: include-what-you-use | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
iwyu: | |
runs-on: ubuntu-22.04 | |
container: | |
image: "fedora:latest" | |
steps: | |
- uses: actions/checkout@v3 | |
# TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image | |
- name: Install missing software on debian/ubuntu | |
if: false | |
run: | | |
apt-get update | |
apt-get install -y cmake g++ make libpcre3-dev | |
apt-get install -y qtbase5-dev qttools5-dev libqt5charts5-dev | |
apt-get install -y wget iwyu | |
ln -s ../x86_64-linux-gnu/qt5 /usr/include/qt | |
# TODO: the package is no longer found in the AUR - it is also outdated | |
- name: Install missing software on archlinux | |
if: false | |
run: | | |
set -x | |
pacman -Sy | |
pacman -S cmake make gcc qt5-base qt5-tools qt5-charts pcre wget --noconfirm | |
pacman-key --init | |
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com | |
pacman-key --lsign-key 3056513887B78AEB | |
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm | |
echo "[chaotic-aur]" >> /etc/pacman.conf | |
echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf | |
pacman -Sy | |
pacman -S include-what-you-use --noconfirm | |
ln -s iwyu-tool /usr/sbin/iwyu_tool | |
- name: Install missing software on Fedora | |
run: | | |
dnf install -y cmake gcc-c++ qt5-qtbase-devel | |
dnf install -y iwyu | |
- name: Prepare CMake | |
run: | | |
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off | |
- name: Prepare CMake dependencies | |
run: | | |
# make sure the precompiled headers exist | |
#make -C cmake.output/cli cmake_pch.hxx.pch | |
#make -C cmake.output/gui cmake_pch.hxx.pch | |
#make -C cmake.output/lib cmake_pch.hxx.pch | |
#make -C cmake.output/test cmake_pch.hxx.pch | |
# make sure the auto-generated GUI sources exist | |
make -C cmake.output autogen | |
# make sure the auto-generated GUI dependencies exist | |
make -C cmake.output gui-build-deps | |
make -C cmake.output triage-build-ui-deps | |
- name: Build Qt mappings | |
run: | | |
wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-qt.py | |
python3 iwyu-mapgen-qt.py /usr/include/qt/ > qt5.imp | |
- name: iwyu_tool | |
run: | | |
PWD=$(pwd) | |
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --mapping_file=$PWD/qt5.imp > iwyu.log | |
- uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: Compilation Database | |
path: ./cmake.output/compile_commands.json | |
- uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: Qt Mappings | |
path: ./qt5.imp | |
- uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: Logs (include-what-you-use) | |
path: ./*.log | |