Skip to content

Commit 901ad55

Browse files
committed
[INFRA] use seqan/actions/iwyu
1 parent 3703791 commit 901ad55

File tree

11 files changed

+15
-1046
lines changed

11 files changed

+15
-1046
lines changed

.github/workflows/ci_iwyu.yml

Lines changed: 6 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -26,87 +26,14 @@ jobs:
2626
runs-on: ubuntu-latest
2727
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
2828
container:
29-
image: ghcr.io/seqan/clang-18
29+
image: ghcr.io/seqan/clang-19
3030
volumes:
3131
- /home/runner:/home/runner
3232
steps:
33-
- name: Checkout
34-
uses: actions/checkout@v4
33+
- name: Run IWYU
34+
uses: seqan/actions/iwyu@main
3535
with:
36-
path: hibf
36+
configure_path: test/all
3737
token: ${{ secrets.SEQAN_ACTIONS_PAT }}
38-
39-
- name: Build IWYU
40-
run: |
41-
mkdir iwyu && cd iwyu
42-
git clone https://github.com/include-what-you-use/include-what-you-use.git --branch 0.22
43-
mkdir build && cd build
44-
cmake ../include-what-you-use -G "Unix Makefiles" \
45-
-DCMAKE_BUILD_TYPE=Release \
46-
-DCMAKE_INSTALL_PREFIX=/usr \
47-
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-18 \
48-
-DCMAKE_C_COMPILER=clang-18 \
49-
-DCMAKE_CXX_COMPILER=clang++-18
50-
make -j
51-
make install
52-
53-
- name: Configure Test
54-
run: |
55-
mkdir build && cd build
56-
cmake ../hibf/test/iwyu -DCMAKE_BUILD_TYPE=Debug
57-
58-
- name: Run Test
59-
working-directory: build
60-
run: |
61-
ccache -z
62-
make -j 2> out.txt
63-
ccache -sv
64-
65-
- name: Apply changes
66-
working-directory: build
67-
run: |
68-
fix_includes.py --nosafe_headers \
69-
--comments \
70-
--noreorder \
71-
--ignore_re ".*/include/hibf/contrib/.*" < out.txt
72-
73-
- name: Add changes
74-
id: changed_files
75-
working-directory: hibf
76-
run: |
77-
git add .
78-
CPP_LIST=$(git diff --name-only HEAD | { grep -E "(\.cpp|\.hpp)$" || test $? = 1; } | xargs)
79-
echo "cpp_list=$CPP_LIST" >> $GITHUB_OUTPUT
80-
81-
- name: Run clang-format
82-
if: ${{ steps.changed_files.outputs.cpp_list }}
83-
working-directory: hibf
84-
run: |
85-
clang-format-18 --style=file -i ${{ steps.changed_files.outputs.cpp_list }}
86-
git add .
87-
88-
- name: Import GPG key
89-
if: ${{ steps.changed_files.outputs.cpp_list }}
90-
uses: crazy-max/ghaction-import-gpg@v6
91-
with:
92-
gpg_private_key: ${{ secrets.SEQAN_ACTIONS_GPG_KEY }}
93-
passphrase: ${{ secrets.SEQAN_ACTIONS_GPG_PASSPHRASE }}
94-
git_user_signingkey: true
95-
git_commit_gpgsign: true
96-
workdir: hibf
97-
98-
- name: Open PR
99-
if: ${{ steps.changed_files.outputs.cpp_list }}
100-
uses: peter-evans/create-pull-request@v7
101-
with:
102-
token: ${{ secrets.SEQAN_ACTIONS_PAT }}
103-
path: hibf
104-
commit-message: "[MISC] IWYU"
105-
committer: "seqan-actions[bot] <seqan-actions@users.noreply.github.com>"
106-
author: "seqan-actions[bot] <seqan-actions@users.noreply.github.com>"
107-
branch: "actions/iwyu"
108-
delete-branch: true
109-
title: "[MISC] IWYU"
110-
body: "Auto-generated include-what-you-use changes"
111-
112-
38+
gpg_key: ${{ secrets.SEQAN_ACTIONS_GPG_KEY }}
39+
gpg_passphrase: ${{ secrets.SEQAN_ACTIONS_GPG_PASSPHRASE }}

include/hibf/platform.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99

1010
#pragma once
1111

12+
// IWYU pragma: always_keep
13+
// IWYU pragma: begin_exports
14+
1215
#include <version> // for __cpp_lib_constexpr_vector
1316

17+
// IWYU pragma: end_exports
18+
1419
// macro cruft
1520
//!\cond
1621
#define HIBF_STR_HELPER(x) #x

include/hibf/version.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
#pragma once
66

7-
#include <cstddef> // for size_t
8-
#include <cstdint> // for uint8_t
7+
// IWYU pragma: always_keep
8+
9+
#include <cinttypes> // for uint8_t
10+
#include <cstddef> // for size_t
911

1012
/*!\file
1113
* \brief Provides version macros and global variables.

test/iwyu/CMakeLists.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)