Skip to content

Commit 4240da3

Browse files
authored
[CI] Split lint workflow (#535)
- separate lint tasks into C++ and Python workflows - update main workflow to call the new lint workflows
1 parent 3c6975e commit 4240da3

File tree

3 files changed

+44
-26
lines changed

3 files changed

+44
-26
lines changed

.github/workflows/cpp-lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: C++ Lint
2+
3+
on:
4+
workflow_call:
5+
push:
6+
paths:
7+
- '**/*.cpp'
8+
- '**/*.hpp'
9+
- '**/*.c'
10+
- '**/*.h'
11+
- '.clang-format'
12+
- '.github/workflows/cpp-lint.yml'
13+
pull_request:
14+
paths:
15+
- '**/*.cpp'
16+
- '**/*.hpp'
17+
- '**/*.c'
18+
- '**/*.h'
19+
- '.clang-format'
20+
- '.github/workflows/cpp-lint.yml'
21+
22+
jobs:
23+
clang-format:
24+
runs-on: ubuntu-24.04
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: DoozyX/clang-format-lint-action@v0.20
28+
with:
29+
source: '.'
30+
clangFormatVersion: 20

.github/workflows/main.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@ concurrency:
1616
!startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
1717
1818
jobs:
19-
lint:
20-
uses: ./.github/workflows/lint.yml
19+
cpp-lint:
20+
uses: ./.github/workflows/cpp-lint.yml
21+
python-lint:
22+
uses: ./.github/workflows/python-lint.yml
2123
ubuntu:
2224
needs:
23-
- lint
25+
- cpp-lint
26+
- python-lint
2427
uses: ./.github/workflows/ubuntu.yml
2528
mac:
2629
needs:
27-
- lint
30+
- cpp-lint
31+
- python-lint
2832
uses: ./.github/workflows/mac.yml
2933
windows:
3034
needs:
31-
- lint
35+
- cpp-lint
36+
- python-lint
3237
uses: ./.github/workflows/windows.yml
3338
perf:
3439
needs:

.github/workflows/lint.yml renamed to .github/workflows/python-lint.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,21 @@
1+
name: Python Lint
2+
13
on:
24
workflow_call:
35
push:
46
paths:
5-
- '**/*.cpp'
6-
- '**/*.hpp'
7-
- '**/*.c'
8-
- '**/*.h'
97
- '**/*.py'
108
- '**/*.sh'
11-
- '.clang-format'
129
- 'setup.cfg'
13-
- '.github/workflows/lint.yml'
10+
- '.github/workflows/python-lint.yml'
1411
pull_request:
1512
paths:
16-
- '**/*.cpp'
17-
- '**/*.hpp'
18-
- '**/*.c'
19-
- '**/*.h'
2013
- '**/*.py'
2114
- '**/*.sh'
22-
- '.clang-format'
2315
- 'setup.cfg'
24-
- '.github/workflows/lint.yml'
16+
- '.github/workflows/python-lint.yml'
2517

2618
jobs:
27-
clang-format:
28-
runs-on: ubuntu-24.04
29-
steps:
30-
- uses: actions/checkout@v4
31-
- uses: DoozyX/clang-format-lint-action@v0.20
32-
with:
33-
source: '.'
34-
clangFormatVersion: 20
35-
3619
python-lint:
3720
runs-on: ubuntu-24.04
3821
steps:

0 commit comments

Comments
 (0)