-
Notifications
You must be signed in to change notification settings - Fork 2.3k
96 lines (79 loc) · 3.02 KB
/
code_style.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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Code Style
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
clang-format:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'true'
- name: Install clang-format-15
run: |
sudo apt update
sudo apt --assume-yes install clang-format-15
# Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector
- name: CMake configure
run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -B build
- name: Create code style diff
run: cmake --build build --target clang_format_fix_all -j8
- name: suggester / clang-format
if: startsWith(github.event_name, 'pull_request')
uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3 # v1.18.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning
fail_on_error: true
ShellCheck:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'true'
- name: Install ShellCheck
run: |
sudo apt update
sudo apt --assume-yes install shellcheck
- name: CMake configure
run: cmake -B build
- name: Shellcheck cmake target
run: cmake --build build --target ov_shellcheck -j8
# always provide suggestions even for skipped scripts in ov_shellcheck tagret
- name: ShellCheck action
if: always()
uses: reviewdog/action-shellcheck@ccaafec556ffa154f112bfcb7b9c9574190b7091 # v1.27.0
with:
level: style
reporter: github-pr-review
check_all_files_with_shebangs: true
fail_on_error: true
exclude: |
"*/thirdparty/*"
"./temp/*"
NamingConventionCheck:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'true'
- name: Install Clang dependency
run: |
sudo apt update
sudo apt --assume-yes remove clang-7 clang-8 clang-9 clang-10 clang-11 clang-12 clang-13 clang-15
sudo apt --assume-yes install clang-14 libclang-14-dev
- name: Install Python-based dependencies
run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt
- name: CMake configure
run: cmake -B build
- name: Naming convention check
run: cmake --build build --target ncc_all -j8