Skip to content

Commit

Permalink
iwyu.yml: use Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Apr 2, 2024
1 parent 3977612 commit 0b483b6
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ jobs:
container:
image: ${{ matrix.image }}

env:
QT_VERSION: 6.7.0

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: contains(matrix.image, 'debian')
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
- name: Install missing software on archlinux
if: contains(matrix.image, 'archlinux')
run: |
set -x
pacman -Sy
pacman -S cmake make gcc qt5-base qt5-tools qt5-charts pcre wget --noconfirm
pacman -S cmake make gcc pcre wget --noconfirm
pacman-key --init
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
pacman-key --lsign-key 3056513887B78AEB
Expand All @@ -49,27 +49,37 @@ jobs:
pacman -S include-what-you-use --noconfirm
ln -s iwyu-tool /usr/sbin/iwyu_tool
# TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image
- name: Install missing software on Fedora
if: contains(matrix.image, 'fedora')
run: |
dnf install -y cmake gcc-c++ qt5-qtbase-devel qt5-linguist qt5-qttools-devel qt5-qtcharts-devel pcre-devel
dnf install -y cmake gcc-c++ pcre-devel
dnf install -y wget iwyu
# install and remove the previous Qt version so the depdencies are installed as jurplel/install-qt-action only supports install-deps on debian-based systems
dnf install -y qt5-qtbase-devel qt5-linguist qt5-qttools-devel qt5-qtcharts-devel
dnf remove -y qt5-qtbase-devel qt5-linguist qt5-qttools-devel qt5-qtcharts-devel
ln -s iwyu_tool.py /usr/bin/iwyu_tool
ln -s qt5 /usr/include/qt
- name: Install missing software on OpenSUSE
if: contains(matrix.image, 'opensuse')
run: |
zypper install -y cmake gcc-c++ pcre-devel libQt5Core-devel libQt5Gui-devel libQt5Widgets-devel libQt5PrintSupport-devel libqt5-linguist-devel libqt5-qttools-devel libQt5Network-devel libQt5Charts5-devel libQt5Test-devel
zypper install -y cmake gcc-c++ pcre-devel
zypper install -y wget include-what-you-use-tools
# install and remove the previous Qt version so the depdencies are installed as jurplel/install-qt-action only supports install-deps on debian-based systems
zypper install -y libQt5Core-devel libQt5Gui-devel libQt5Widgets-devel libQt5PrintSupport-devel libqt5-linguist-devel libqt5-qttools-devel libQt5Network-devel libQt5Charts5-devel libQt5Test-devel
zypper remove -y libQt5Core-devel libQt5Gui-devel libQt5Widgets-devel libQt5PrintSupport-devel libqt5-linguist-devel libqt5-qttools-devel libQt5Network-devel libQt5Charts5-devel libQt5Test-devel
ln -s iwyu_tool.py /usr/bin/iwyu_tool
ln -s qt5 /usr/include/qt
# TODO: switch to Qt 6 after we enabled the Qt mappings again
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
install-deps: false

- 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 -DEXTERNALS_AS_SYSTEM=On
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=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 -DEXTERNALS_AS_SYSTEM=On
- name: Prepare CMake dependencies
run: |
Expand All @@ -84,16 +94,11 @@ jobs:
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)
# -isystem/usr/lib/clang/17/include
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -Xiwyu --mapping_file=$PWD/qt5.imp > iwyu.log
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments > iwyu.log
- uses: actions/upload-artifact@v3
if: success() || failure()
Expand All @@ -119,7 +124,7 @@ jobs:
if: ${{ github.repository_owner == 'danmar' }}

env:
QT_VERSION: 5.15.2
QT_VERSION: 6.7.0

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -148,7 +153,7 @@ jobs:

- 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 -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 -DEXTERNALS_AS_SYSTEM=On
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=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 -DEXTERNALS_AS_SYSTEM=On
env:
CC: clang-18
CXX: clang++-18
Expand Down

0 comments on commit 0b483b6

Please sign in to comment.