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

Add clang-tidy check #478

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
bazel-command: "dazel"
bazel-config: "--config=asan"
output-user_root: ""
eventuals-tidy-regex: |
"eventuals[\\\/]eventuals[\\\/]eventuals[\\\/][^.]+.(cc|h)" \
"eventuals[\\\/]eventuals[\\\/]test[\\\/][^.]+.(cc|h)"
- os: windows-2019
sudo-command: "" # The Windows runner already runs as root.
# Explicitly not using `dazel` here as we don't want to
Expand All @@ -51,6 +54,9 @@ jobs:
bazel-config: ""
# Fixes issue #248.
output-user_root: "--output_user_root=C:/bzl"
eventuals-tidy-regex: |
"eventuals[\\\/]eventuals[\\\/]eventuals[\\\/][^.]+.(cc|h)" \
"eventuals[\\\/]eventuals[\\\/]test[\\\/][^.]+.(cc|h)"
# Don't fail all workflows if one fails as we're still getting
# to a stable build right now and when one fails it doesn't mean
# they all will fail.
Expand Down Expand Up @@ -136,6 +142,24 @@ jobs:
--test_arg=--gtest_shuffle \
--test_arg=--gtest_repeat=100

- name: Extract Compile Commands
run: |
${{ matrix.bazel-command }} \
${{ matrix.output-user_root }} \
run \
refresh_cc_github_actions \
-- \
${{ matrix.bazel-config }} \
${{ env.BAZEL_REMOTE_CACHE }} \
--verbose_failures \
--compilation_mode=dbg \
--strip="never"

- name: Run clang-tidy
run: |
run-clang-tidy \
${{ matrix.eventuals-tidy-regex }}

- name: Debug using tmate (if failure)
uses: mxschmitt/action-tmate@v3
# Optionally enable tmate debugging if the workflow was manually-triggered
Expand Down
7 changes: 7 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ refresh_compile_commands(
},
)

refresh_compile_commands(
name = "refresh_cc_github_actions",
targets = {
"//test/...": "",
},
)

########################################################################