Skip to content

Commit 8edffbb

Browse files
authored
Merge pull request #67 from sjinks/add-clang-tidy
ci: add clang-tidy workflow
2 parents 10ec908 + ab1bf76 commit 8edffbb

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/clang-tidy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: clang-tidy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
clang-tidy:
15+
name: Run clang-tidy
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- name: Harden Runner
21+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
22+
with:
23+
egress-policy: block
24+
allowed-endpoints: >
25+
api.github.com:443
26+
azure.archive.ubuntu.com:80
27+
esm.ubuntu.com:443
28+
github.com:443
29+
motd.ubuntu.com:443
30+
objects.githubusercontent.com:443
31+
packages.microsoft.com:443
32+
33+
- name: Check out the source code
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
36+
- name: Install dependencies
37+
uses: ./.github/actions/install-dependencies
38+
39+
- name: Configure
40+
run: cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
41+
42+
- name: Run clang-tidy
43+
run: clang-tidy -p build $(jq -r '.[].file' build/compile_commands.json) --warnings-as-errors='*'

0 commit comments

Comments
 (0)