Skip to content

iwyu action

iwyu action #25

Workflow file for this run

name: IWYU
on:
push:
workflow_dispatch:
jobs:
build:
name: iwyu
runs-on: ubuntu-latest
container: ghcr.io/neomutt/fedora:38
env:
CONFIGURE_OPTIONS: --autocrypt --bdb --full-doc --gdbm --gnutls --gpgme --gss --kyotocabinet --lmdb --lua --lz4 --mixmaster --notmuch --pcre2 --qdbm --rocksdb --sasl --tdb --tokyocabinet --with-lock=fcntl --zlib --zstd
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Checkout IWYU
uses: actions/checkout@v3
with:
repository: neomutt/iwyu
path: iwyu
- name: Compilation Cache
uses: hendrikmuhs/ccache-action@v1
- name: Git Workaround
run: git config --global --add safe.directory $(pwd)
- name: Configure Neomutt
run: ./configure CC=clang --compile-commands $CONFIGURE_OPTIONS
- name: Build Neomutt
run: make CC=clang -j ${{steps.cpu-cores.outputs.count}}
- name: Neomutt Version
run: ./neomutt -v
- name: Clang Format
run: |
find . \( -name .git -o -name queue.h -o -path './test/*' -o -path './autosetup/*' -o -path './docs/*' \) -prune -o -type f -name '*.c' -print | sed 's/^\.\///' | sort | xargs clang-format -i
git diff
- name: Include What You Use
run: |
export IWYU=/usr/bin/include-what-you-use
find . -name '*.[ch]' | sed 's/^\.\///' | grep -v -e debug -e '^test/' -e "^autosetup/" -e "^docs/" -e queue.h | sort | xargs iwyu/bin/iwyu.sh 2>&1 | grep -v "has correct" | cat -s