Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add IWYU (include what you use) action. #2283

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,43 @@ 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
env:
CC: clang
CXX: clang++
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_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release .

- name: Build and cwd
run: |
cmake --build build --parallel $CORES
ls -la /usr/src/googletest || true
ls -la /usr/src/googletest/include || true

- name: Run Include What You Use
env:
CPLUS_INCLUDE_PATH: /usr/include/botan-2;/usr/include/json-c;/usr/src/googletest/include
C_INCLUDE_PATH: /usr/include/botan-2;/usr/include/json-c;/usr/src/googletest/include
uses: EmilGedda/[email protected]
with:
compilation-database-path: 'build'

Loading