From f5119b55906a111b5f2d2035eb785253a39affcf Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Sat, 19 Oct 2024 15:57:16 +0300 Subject: [PATCH] CI: Add IWYU (include what you use) action. --- .github/workflows/lint.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5fce5a8d6..84ae4b555 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -84,3 +84,35 @@ jobs: set -eux pwd [[ "$(cat ./rnp/version.txt)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; + iwyu: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - name: Install dependencies + run: | + sudo apt-get -y update + sudo apt-get -y install cmake libjson-c-dev libbotan-2-dev asciidoctor googletest + + - name: Configure + run: | + echo CORES="$(nproc --all)" >> $GITHUB_ENV + cmake -B build -DBUILD_SHARED_LIBS=ON \ + -DCRYPTO_BACKEND=botan \ + -DDOWNLOAD_GTEST=OFF \ + -DGTEST_SOURCES=/usr/src/googletest \ + -DCMAKE_BUILD_TYPE=Release . + + - name: Build and cwd + run: | + cmake --build build --parallel 2 + cd build + + - name: Run Include What You Use + uses: EmilGedda/include-what-you-use-action@v1.0 + with: + compilation-database-path: 'build' +