|
| 1 | +# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions |
| 2 | +# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners |
| 3 | +name: include-what-you-use |
| 4 | + |
| 5 | +on: workflow_dispatch |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + |
| 10 | + runs-on: ubuntu-20.04 |
| 11 | + |
| 12 | + container: |
| 13 | + image: "kalilinux/kali-rolling" |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + |
| 18 | + # TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image |
| 19 | + - name: Install missing software |
| 20 | + run: | |
| 21 | + apt-get update |
| 22 | + apt-get install -y cmake g++ make libz3-dev libpcre3-dev |
| 23 | + apt-get install -y qtbase5-dev qttools5-dev libqt5charts5-dev |
| 24 | + apt-get install -y wget iwyu |
| 25 | +
|
| 26 | + - name: Prepare CMake |
| 27 | + run: | |
| 28 | + mkdir cmake.output |
| 29 | + cd cmake.output |
| 30 | + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off .. |
| 31 | + cd .. |
| 32 | +
|
| 33 | + - name: Prepare CMake dependencies |
| 34 | + run: | |
| 35 | + # make sure the precompiled headers exist |
| 36 | + #make -C cmake.output lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx |
| 37 | + #make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx |
| 38 | + # make sure the auto-generated GUI sources exist |
| 39 | + make -C cmake.output autogen |
| 40 | + # make sure the auto-generated GUI dependencies exist |
| 41 | + make -C cmake.output gui-build-deps |
| 42 | +
|
| 43 | + - name: Build Qt mappings |
| 44 | + run: | |
| 45 | + wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-qt.py |
| 46 | + python3 iwyu-mapgen-qt.py /usr/include/x86_64-linux-gnu/qt5/ > qt5.imp |
| 47 | +
|
| 48 | + # TODO: the mapping file causes a massive slowdown so we cannot use it at the moment. |
| 49 | + # add "-Xiwyu --mapping_file=qt5.imp" at the end of the whole command if we can use them. |
| 50 | + - name: iwyu_tool |
| 51 | + run: | |
| 52 | + # do not fail for now so the output is being saved |
| 53 | + iwyu_tool -p cmake.output -j $(nproc) -- -w > iwyu.log || true |
| 54 | +
|
| 55 | + - uses: actions/upload-artifact@v2 |
| 56 | + with: |
| 57 | + name: Qt Mappings |
| 58 | + path: ./qt5.imp |
| 59 | + |
| 60 | + - uses: actions/upload-artifact@v2 |
| 61 | + with: |
| 62 | + name: Logs |
| 63 | + path: ./*.log |
0 commit comments