-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
63 lines (56 loc) · 1.85 KB
/
action.yml
File metadata and controls
63 lines (56 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Code Convention Check"
description: "Enforce Silicon Labs C/C++ coding standards (formatting, naming, spelling)"
inputs:
exclude-regex:
description: |
Regex pattern to exclude paths from all checks.
Format: Python regex, use | for OR.
Example: .*\/generated\/.*|.*\.pb\.c
required: false
default: ""
codespell-ignore-words:
description: |
Words for codespell to ignore.
Format: Comma-separated, case-insensitive.
Example: hsi,aci,dout,teh
required: false
default: ""
codespell-skip-paths:
description: |
Files/directories for codespell to skip.
Format: Comma-separated glob patterns (fnmatch-style), not regex. Avoid using **.
Example: *.bin,docs/*,third_party/*
required: false
default: ""
runs:
using: "composite"
steps:
- name: Build Code Convention Docker Image
shell: bash
run: |
docker build -t coding-convention-tool:${{ github.sha }} ${{ github.action_path }}
- name: Run Code Convention Checks
shell: bash
run: |
docker run --rm \
-v "${{ github.workspace }}:/src" \
-e EXCLUDE_REGEX="${{ inputs.exclude-regex }}" \
-e CODESPELL_IGNORE_WORDS="${{ inputs.codespell-ignore-words }}" \
-e CODESPELL_SKIP_PATHS="${{ inputs.codespell-skip-paths }}" \
coding-convention-tool:${{ github.sha }}
- name: Upload Results
uses: actions/upload-artifact@v4
if: always()
continue-on-error: true
with:
name: CodingConventionResult
path: ${{ github.workspace }}/CodingConventionTool.txt
retention-days: 3
- name: Upload Patch
uses: actions/upload-artifact@v4
if: always()
continue-on-error: true
with:
name: code-fix.patch
path: ${{ github.workspace }}/code-fix.patch
retention-days: 3