Skip to content

Commit baaf637

Browse files
committed
ci: split language and all content compliance checks
Signed-off-by: Nick Schonning <nschonni@gmail.com>
1 parent 20185c8 commit baaf637

4 files changed

Lines changed: 102 additions & 52 deletions

File tree

.github/workflows/lint-clang.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Lint C/Proto files
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
has-changes:
8+
runs-on: ubuntu-24.04
9+
permissions:
10+
pull-requests: read
11+
outputs:
12+
should-build: steps.filter.outputs.src == 'true'
13+
steps:
14+
- uses: dorny/paths-filter@v4
15+
id: filter
16+
with:
17+
filters: |
18+
src:
19+
- ".github/workflows/lint-clang.yml"
20+
- ".clang-format*"
21+
- "**/*.c"
22+
- "**/*.h"
23+
- "**/*.proto"
24+
lint:
25+
needs: has-changes
26+
runs-on: ubuntu-24.04
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v7
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Rebase onto target branch
34+
uses: ./.github/actions/rebase
35+
36+
- name: Run clang-format
37+
uses: jidicula/clang-format-action@v4.18.0
38+
with:
39+
clang-format-version: "22"

.github/workflows/lint-commit.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint commit messages
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v7
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v7
17+
with:
18+
python-version: "3.13"
19+
20+
- name: Install GitLint
21+
run: pip install gitlint
22+
23+
- name: Run GitLint
24+
env:
25+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
26+
run: gitlint --commits "origin/${GITHUB_BASE_REF}..${HEAD_SHA}"
Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
1-
name: Compliance checks
1+
name: Lint license headers
22

33
on:
4-
pull_request: {}
4+
pull_request:
55

66
jobs:
77
lint:
8-
runs-on: ubuntu-24.04
9-
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v7
12-
with:
13-
fetch-depth: 0
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v7
17-
with:
18-
python-version: "3.13"
19-
20-
- name: Install GitLint
21-
run: pip install gitlint
22-
23-
- name: Run GitLint
24-
env:
25-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
26-
run: gitlint --commits "origin/${GITHUB_BASE_REF}..${HEAD_SHA}"
27-
28-
ruff:
29-
runs-on: ubuntu-24.04
30-
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v7
33-
with:
34-
fetch-depth: 0
35-
36-
- name: Rebase onto target branch
37-
uses: ./.github/actions/rebase
38-
39-
- uses: astral-sh/ruff-action@v4.1.0
40-
41-
license:
428
runs-on: ubuntu-24.04
439
steps:
4410
- name: Checkout
@@ -101,19 +67,3 @@ jobs:
10167
echo " /* SPDX-License-Identifier: Apache-2.0 */"
10268
exit 1
10369
fi
104-
105-
clang-format:
106-
runs-on: ubuntu-24.04
107-
steps:
108-
- name: Checkout
109-
uses: actions/checkout@v7
110-
with:
111-
fetch-depth: 0
112-
113-
- name: Rebase onto target branch
114-
uses: ./.github/actions/rebase
115-
116-
- name: Run clang-format
117-
uses: jidicula/clang-format-action@v4.18.0
118-
with:
119-
clang-format-version: "22"

.github/workflows/lint-python.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint Python files
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
has-changes:
8+
runs-on: ubuntu-24.04
9+
permissions:
10+
pull-requests: read
11+
outputs:
12+
should-build: steps.filter.outputs.src == 'true'
13+
steps:
14+
- uses: dorny/paths-filter@v4
15+
id: filter
16+
with:
17+
filters: |
18+
src:
19+
- ".github/workflows/lint-python.yml"
20+
- ".ruff.toml"
21+
- "**/*.py"
22+
- "!sdk/waf/waflib/**/*.py"
23+
lint:
24+
needs: has-changes
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v7
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Rebase onto target branch
33+
uses: ./.github/actions/rebase
34+
35+
- uses: astral-sh/ruff-action@v4.1.0

0 commit comments

Comments
 (0)