Skip to content

Commit

Permalink
iwyu action
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Jan 22, 2024
1 parent 8e897d1 commit 049fe2d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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

0 comments on commit 049fe2d

Please sign in to comment.