|
81 | 81 | - name: Test |
82 | 82 | shell: bash |
83 | 83 | run: ctest --preset test-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} |
| 84 | + |
| 85 | + linux-static_analysis: |
| 86 | + name: Static Analysis, ${{ matrix.os }}, ${{ matrix.compiler.name }}, ${{ matrix.buildtype }} |
| 87 | + runs-on: ${{ matrix.os }} |
| 88 | + strategy: |
| 89 | + fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix entry fails. |
| 90 | + matrix: |
| 91 | + os: [ubuntu-22.04] |
| 92 | + buildtype: [debug] |
| 93 | + compiler: [{name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15 llvm-15-dev libclang-15-dev', iwyu_branch: 'clang_15', path_prefix: "/usr/lib/llvm-15"}] |
| 94 | + |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v3 |
| 97 | + |
| 98 | + - name: Cache |
| 99 | + uses: actions/cache@v3 |
| 100 | + env: |
| 101 | + cache-name: cache-conan-modules |
| 102 | + with: |
| 103 | + path: | |
| 104 | + ${{ env.CONAN_USER_HOME }} |
| 105 | + ~/.cache/pip |
| 106 | + key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }} |
| 107 | + |
| 108 | + - name: Install conan |
| 109 | + shell: bash |
| 110 | + run: | |
| 111 | + python3 -m pip install --upgrade pip setuptools conan==1.59 |
| 112 | + source ~/.profile |
| 113 | +
|
| 114 | + - name: Install dependencies |
| 115 | + run: | |
| 116 | + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" |
| 117 | + sudo apt update |
| 118 | + sudo apt install ninja-build ${{ matrix.compiler.pkgs }} cppcheck |
| 119 | + shell: bash |
| 120 | + |
| 121 | + - name: Compile and install IWYU |
| 122 | + run: | |
| 123 | + mkdir iwyu && cd iwyu |
| 124 | + git clone https://github.com/include-what-you-use/include-what-you-use.git |
| 125 | + cd include-what-you-use |
| 126 | + git checkout ${{ matrix.compiler.iwyu_branch }} |
| 127 | + cd .. |
| 128 | + mkdir build && cd build |
| 129 | + cmake -G "Ninja" -DCMAKE_PREFIX_PATH=${{ matrix.compiler.path_prefix }} ../include-what-you-use |
| 130 | + ninja |
| 131 | + sudo ninja install |
| 132 | + shell: bash |
| 133 | + |
| 134 | + - name: Configure via CMake |
| 135 | + shell: bash |
| 136 | + run: cmake --preset unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-static-analysis |
| 137 | + |
| 138 | + - name: Build |
| 139 | + shell: bash |
| 140 | + run: cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-static-analysis |
0 commit comments