forked from bpftrace/bpftrace
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental job to enable clang-tidy. This action should only run against the changes made in the PR. This closes bpftrace#2971.
- Loading branch information
Showing
1 changed file
with
41 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,41 @@ | ||
name: "Clang Tidy" | ||
|
||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
# Cancel previous run if a new one is started | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: DeterminateSystems/nix-installer-action@v4 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
|
||
- name: Generate compile_commands.json and headers | ||
run: | | ||
mkdir $GITHUB_WORKSPACE/build && cd $GITHUB_WORKSPACE/build | ||
nix develop --command cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 | ||
nix develop --command make -j$(nproc) | ||
- name: Run clang-tidy | ||
uses: ZedThree/clang-tidy-review@v0.17.1 | ||
id: review | ||
with: | ||
build_dir: build | ||
lgtm_comment_body: "" | ||
|
||
- name: Fail job if comments posted | ||
if: steps.review.outputs.total_comments > 0 | ||
run: exit 1 |