Skip to content

Commit 3ab68cb

Browse files
committed
Optimize GitHub Actions triggers for CI, clang-format, and clang-tidy
1 parent 5ed3c59 commit 3ab68cb

File tree

3 files changed

+41
-14
lines changed

3 files changed

+41
-14
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@ name: CI
33
on:
44
push:
55
branches: [ master ]
6+
paths:
7+
- '**/*.cpp'
8+
- '**/*.hpp'
9+
- 'CMakeLists.txt'
10+
- 'CMakePresets.json'
11+
- 'cmake/**'
12+
- '.github/workflows/ci.yml'
613
pull_request:
714
branches: [ master ]
15+
paths:
16+
- '**/*.cpp'
17+
- '**/*.hpp'
18+
- 'CMakeLists.txt'
19+
- 'CMakePresets.json'
20+
- 'cmake/**'
21+
- '.github/workflows/ci.yml'
822

923
jobs:
1024
build-and-test:
@@ -16,9 +30,6 @@ jobs:
1630
compiler: [gcc, clang]
1731
build_type: [RelWithDebInfo, Sanitize]
1832

19-
env:
20-
ENABLE_TESTING: ON
21-
2233
steps:
2334
- name: Checkout code
2435
uses: actions/checkout@v4

.github/workflows/clang-format.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: clang-format
22

33
on:
4-
pull_request:
5-
paths:
6-
- '**.cpp'
7-
- '**.hpp'
84
push:
95
branches:
106
- master
7+
paths:
8+
- '**/*.cpp'
9+
- '**/*.hpp'
10+
- '.clang-format'
11+
- '.github/workflows/clang-format.yml'
12+
pull_request:
13+
paths:
14+
- '**/*.cpp'
15+
- '**/*.hpp'
16+
- '.clang-format'
17+
- '.github/workflows/clang-format.yml'
1118

1219
jobs:
1320
format-check:

.github/workflows/clang-tidy.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
name: clang-tidy
22

33
on:
4-
pull_request:
5-
paths:
6-
- '**.cpp'
7-
- '**.h'
8-
- '**.hpp'
94
push:
105
branches:
116
- master
7+
paths:
8+
- '**/*.cpp'
9+
- '**/*.hpp'
10+
- '.clang-tidy'
11+
- 'CMakePresets.json'
12+
- 'CMakeLists.txt'
13+
- '.github/workflows/clang-tidy.yml'
14+
pull_request:
15+
paths:
16+
- '**/*.cpp'
17+
- '**/*.hpp'
18+
- '.clang-tidy'
19+
- 'CMakePresets.json'
20+
- 'CMakeLists.txt'
21+
- '.github/workflows/clang-tidy.yml'
1222

1323
jobs:
1424
lint:
@@ -27,5 +37,4 @@ jobs:
2737

2838
- name: Run clang-tidy
2939
run: |
30-
find src include tests -name '*.cpp' \
31-
| xargs clang-tidy -p build/gcc-RelWithDebInfo
40+
find src include tests -name '*.cpp' | xargs clang-tidy -p build/gcc-RelWithDebInfo

0 commit comments

Comments
 (0)