]> git.sesse.net Git - stockfish/blob - .github/workflows/stockfish_analyzers.yml
Fix compilation after recent merge.
[stockfish] / .github / workflows / stockfish_analyzers.yml
1 name: Stockfish
2 on:
3   workflow_call:
4 jobs:
5   Analyzers:
6     name: Check includes
7     runs-on: ubuntu-22.04
8     defaults:
9       run:
10         working-directory: Stockfish/src
11         shell: bash
12     steps:
13       - name: Checkout Stockfish
14         uses: actions/checkout@v4
15         with:
16           path: Stockfish
17
18       - name: Checkout include-what-you-use
19         uses: actions/checkout@v4
20         with:
21           repository: include-what-you-use/include-what-you-use
22           ref: f25caa280dc3277c4086ec345ad279a2463fea0f
23           path: include-what-you-use
24
25       - name: Download required linux packages
26         run: |
27           sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main'
28           wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
29           sudo apt update
30           sudo apt install -y libclang-17-dev clang-17 libc++-17-dev
31
32       - name: Set up include-what-you-use
33         run: |
34           mkdir build && cd build
35           cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH="/usr/lib/llvm-17" ..
36           sudo make install
37         working-directory: include-what-you-use
38
39       - name: Check include-what-you-use
40         run: include-what-you-use --version
41
42       - name: Check includes
43         run: >
44           make analyze
45           COMP=clang
46           CXX=include-what-you-use
47           CXXFLAGS="-stdlib=libc++ -Xiwyu --comment_style=long -Xiwyu --mapping='${{ github.workspace }}/Stockfish/.github/workflows/libcxx17.imp' -Xiwyu --error"