2022-02-01 17:19:19 +01:00
|
|
|
# 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: workflow_dispatch
|
|
|
|
|
2022-08-26 23:25:07 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-02-01 17:19:19 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2022-05-31 19:55:57 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-02-01 17:19:19 +01:00
|
|
|
|
|
|
|
container:
|
2022-09-16 07:15:49 +02:00
|
|
|
image: "debian:unstable" # use latest debian image to get latest include-what-you-get
|
2022-02-01 17:19:19 +01:00
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-01 17:19:19 +01:00
|
|
|
|
|
|
|
# TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image
|
|
|
|
- name: Install missing software
|
|
|
|
run: |
|
|
|
|
apt-get update
|
2022-04-11 07:30:55 +02:00
|
|
|
apt-get install -y cmake g++ make libpcre3-dev
|
2022-02-01 17:19:19 +01:00
|
|
|
apt-get install -y qtbase5-dev qttools5-dev libqt5charts5-dev
|
|
|
|
apt-get install -y wget iwyu
|
|
|
|
|
|
|
|
- name: Prepare CMake
|
|
|
|
run: |
|
2022-09-25 09:20:34 +02:00
|
|
|
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=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
|
2022-02-01 17:19:19 +01:00
|
|
|
|
|
|
|
- name: Prepare CMake dependencies
|
|
|
|
run: |
|
|
|
|
# make sure the precompiled headers exist
|
2023-01-26 22:13:07 +01:00
|
|
|
#make -C cmake.output lib/CMakeFiles/cppcheck-core.dir/cmake_pch.hxx.cxx
|
2022-02-01 17:19:19 +01:00
|
|
|
#make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx
|
|
|
|
# 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
|
2023-03-02 21:50:14 +01:00
|
|
|
make -C cmake.output triage-build-ui-deps
|
2022-02-01 17:19:19 +01:00
|
|
|
|
|
|
|
- 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/x86_64-linux-gnu/qt5/ > qt5.imp
|
|
|
|
|
|
|
|
# TODO: the mapping file causes a massive slowdown so we cannot use it at the moment.
|
|
|
|
# add "-Xiwyu --mapping_file=qt5.imp" at the end of the whole command if we can use them.
|
|
|
|
- name: iwyu_tool
|
|
|
|
run: |
|
|
|
|
# do not fail for now so the output is being saved
|
|
|
|
iwyu_tool -p cmake.output -j $(nproc) -- -w > iwyu.log || true
|
|
|
|
|
2023-03-02 21:50:14 +01:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: Compilation Database
|
|
|
|
path: ./cmake.output/compile_commands.json
|
|
|
|
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-02-01 17:19:19 +01:00
|
|
|
with:
|
|
|
|
name: Qt Mappings
|
|
|
|
path: ./qt5.imp
|
|
|
|
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-02-01 17:19:19 +01:00
|
|
|
with:
|
|
|
|
name: Logs
|
|
|
|
path: ./*.log
|