-
-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||