Skip to content

Commit

Permalink
iwyu.yml: also run with libc++
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Aug 30, 2024
1 parent ecb436a commit 425b1ea
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
strategy:
matrix:
image: ["fedora:latest"] # "opensuse/tumbleweed:latest" / "fedora:latest" / "debian:unstable" / "archlinux:latest"
stdlib: [libstdc++, libc++]
include:
- stdlib: libstdc++
use_libcxx: Off
- stdlib: libc++
use_libcxx: On
fail-fast: false

runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'danmar' }}
Expand Down Expand Up @@ -57,12 +64,17 @@ jobs:
- name: Install missing software on Fedora
if: contains(matrix.image, 'fedora')
run: |
dnf install -y cmake clang pcre-devel
dnf install -y cmake clang libcxx-devel pcre-devel
dnf install -y libglvnd-devel # fixes missing dependency for Qt in CMake
dnf install -y p7zip-plugins # required as fallback for py7zr in Qt installation
dnf install -y iwyu
ln -s iwyu_tool.py /usr/bin/iwyu_tool
- name: Install libc++ software on Fedora
if: matrix.use_libcxx == 'On'
run: |
dnf install -y libcxx-devel
- name: Install missing software on OpenSUSE
if: contains(matrix.image, 'opensuse')
run: |
Expand All @@ -87,7 +99,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 -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
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 -DUSE_LIBCXX=${{ matrix.use_libcxx }}
env:
CC: clang
CXX: clang++
Expand Down Expand Up @@ -116,17 +128,27 @@ jobs:
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Compilation Database
name: Compilation Database (${{ matrix.stdlib }})
path: ./cmake.output/compile_commands.json

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs (include-what-you-use)
name: Logs (include-what-you-use - ${{ matrix.stdlib }})
path: ./*.log

clang-include-cleaner:

strategy:
matrix:
stdlib: [libstdc++, libc++]
include:
- stdlib: libstdc++
use_libcxx: Off
- stdlib: libc++
use_libcxx: On
fail-fast: false

runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'danmar' }}

Expand All @@ -148,7 +170,12 @@ jobs:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
sudo apt-get install -y clang-tools-19
sudo apt-get install -y clang-tools-19 libc++-19
- name: Install libc++
if: matrix.use_libcxx == 'On'
run: |
sudo apt-get install -y libc++-19
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
Expand All @@ -160,7 +187,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 -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
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 -DUSE_LIBCXX=${{ matrix.use_libcxx }}
env:
CC: clang-19
CXX: clang++-19
Expand All @@ -183,6 +210,7 @@ jobs:
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-19 --print=changes --extra-arg=-w -p cmake.output > clang-include-cleaner.log 2>&1
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs (clang-include-cleaner)
name: Logs (clang-include-cleaner - ${{ matrix.stdlib }})
path: ./*.log

0 comments on commit 425b1ea

Please sign in to comment.