forked from kubernetes-client/c
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.3 KB
/
code-check.yml
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
name: Code Check
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [assigned, opened, synchronize, reopened]
jobs:
code-static-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt-get update
sudo apt-get install -y cppcheck
- name: Code static check for config
run: sh ./code-check/code-static-check.sh ./kubernetes/config/
- name: Code static check for examples
run: sh ./code-check/code-static-check.sh ./examples/
code-style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt-get update
sudo apt-get install -y indent
- name: Code style check for config
run: |
find ./kubernetes/config/ -type f -regextype posix-extended -regex ".*\.(c|h)" -exec sh ./code-check/code-style-check.sh {} \;
find ./kubernetes/config/ -type f -regextype posix-extended -regex ".*\.(c|h)" -exec diff {} {}~ \;
- name: Code style check for examples
run: |
find ./examples/ -type f -regextype posix-extended -regex ".*\.(c|h)" -exec sh ./code-check/code-style-check.sh {} \;
find ./examples/ -type f -regextype posix-extended -regex ".*\.(c|h)" -exec diff {} {}~ \;