Files
openvino/.github/workflows/code_style.yml
Ilya Lavrenov 246932a5d3 Py code style (#6086)
* GitHub CI: Enable Python for Code style

* Update formatting

* Fix

* Add cython

* Add upgrade pip

* Update to src/requirements-dev.txt

* Fixed clang code style

Co-authored-by: azhogov <alexander.zhogov@intel.com>
2021-06-08 20:24:11 +03:00

69 lines
1.9 KiB
YAML

name: Code Style
on: [push, pull_request]
jobs:
clang-format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install clang-format-9
run: sudo apt --assume-yes install clang-format-9
- name: Install dependencies
run: |
sudo apt --assume-yes install libusb-1.0-0-dev
python3 -m pip install --upgrade pip
python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
# Add for -DENABLE_PYTHON=ON, no cython
python3 -m pip install -r ./inference-engine/ie_bridges/python/src/requirements-dev.txt
# Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector
- name: CMake
run: |
mkdir build
cd build
cmake -DENABLE_PYTHON=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT ..
- name: Check code style
run: cmake --build build --target clang_format_check_all
- name: Create code style diff
if: failure()
run: |
cmake --build build --target clang_format_fix_all
git diff > code_style_diff.diff
- uses: actions/upload-artifact@v2
if: failure()
with:
name: code_style_diff
path: code_style_diff.diff
ShellCheck:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install ShellCheck
run: sudo apt --assume-yes install shellcheck
- name: Install dependencies
run: |
sudo apt --assume-yes install libusb-1.0-0-dev
python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
- name: CMake
run: |
mkdir build
cd build
cmake ..
- name: ShellCheck
run: make ie_shellcheck
working-directory: build