Code Style #179608
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Code Style | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: read-all | |
| jobs: | |
| Smart_CI: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false || github.run_attempt > 1 | |
| outputs: | |
| affected_components: "${{ steps.smart_ci.outputs.affected_components }}" | |
| changed_components: "${{ steps.smart_ci.outputs.changed_components }}" | |
| skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}" | |
| steps: | |
| - name: checkout action | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| with: | |
| sparse-checkout: .github/actions/smart-ci | |
| - name: Get affected components | |
| id: smart_ci | |
| uses: ./.github/actions/smart-ci | |
| with: | |
| repository: ${{ github.repository }} | |
| pr: ${{ github.event.number }} | |
| commit_sha: ${{ github.sha }} | |
| ref_name: ${{ github.ref_name }} | |
| component_pattern: "category: (.*)" | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| skip_when_only_listed_labels_set: 'docs' | |
| skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg' | |
| - name: Show affected components | |
| run: | | |
| echo "${{ toJSON(steps.smart_ci.outputs.affected_components) }}" | |
| shell: bash | |
| Docker: | |
| needs: Smart_CI | |
| runs-on: aks-linux-4-cores-16gb-docker-build | |
| container: | |
| image: openvinogithubactions.azurecr.io/docker_build:0.2 | |
| volumes: | |
| - /mount:/mount | |
| outputs: | |
| images: "${{ steps.handle_docker.outputs.images }}" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| - uses: ./.github/actions/handle_docker | |
| id: handle_docker | |
| with: | |
| images: | | |
| ov_test/ubuntu_24_04_x64_code_style | |
| ov_test/ubuntu_22_04_x64_code_style | |
| registry: 'openvinogithubactions.azurecr.io' | |
| dockerfiles_root_dir: '.github/dockerfiles' | |
| changed_components: ${{ needs.smart_ci.outputs.changed_components }} | |
| clang-format: | |
| needs: Docker | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} | |
| volumes: | |
| - /mount:/mount | |
| options: --user 1001 # We use standard github-actions user inside container to avoid permission issues after checkout | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| with: | |
| submodules: 'true' | |
| # Run cmake with extra options to cover as much source code as possible: | |
| # - -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector | |
| # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation | |
| - name: CMake configure | |
| run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -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@4747dbc9f9e37adba0943e681cc20db466642158 # v1.19.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| level: warning | |
| fail_level: error | |
| filter_mode: nofilter | |
| clang-format-aarch64: | |
| needs: Docker | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} | |
| volumes: | |
| - /mount:/mount | |
| options: --user 1001 # We use standard github-actions user inside container to avoid permission issues after checkout | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| with: | |
| submodules: 'true' | |
| # Run cmake with extra options to cover as much source code as possible: | |
| # - -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector | |
| # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation | |
| - name: CMake configure | |
| run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -DCMAKE_TOOLCHAIN_FILE=cmake/arm64.toolchain.cmake -B build_arm64 | |
| - name: Create code style diff | |
| run: cmake --build build_arm64 --target clang_format_fix_all -j8 | |
| - name: suggester / clang-format | |
| if: startsWith(github.event_name, 'pull_request') | |
| uses: reviewdog/action-suggester@4747dbc9f9e37adba0943e681cc20db466642158 # v1.19.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| level: warning | |
| fail_level: error | |
| filter_mode: nofilter | |
| clang-format-riscv64: | |
| needs: Docker | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} | |
| volumes: | |
| - /mount:/mount | |
| options: --user 1001 # We use standard github-actions user inside container to avoid permission issues after checkout | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| with: | |
| submodules: 'true' | |
| - name: CMake configure | |
| run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=FULL -DSELECTIVE_BUILD=COLLECT -DTHREADING=SEQ -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64 | |
| - name: Create code style diff | |
| run: cmake --build build_riscv64 --target clang_format_fix_all -j8 | |
| - name: suggester / clang-format | |
| if: startsWith(github.event_name, 'pull_request') | |
| uses: reviewdog/action-suggester@4747dbc9f9e37adba0943e681cc20db466642158 # v1.19.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| level: warning | |
| fail_level: error | |
| filter_mode: nofilter | |
| ShellCheck: | |
| needs: Docker | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} | |
| volumes: | |
| - /mount:/mount | |
| options: --user 1001 # We use standard github-actions user inside container to avoid permission issues after checkout | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| with: | |
| submodules: 'true' | |
| - 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@4c07458293ac342d477251099501a718ae5ef86e # v1.32.0 | |
| with: | |
| level: style | |
| reporter: github-pr-review | |
| check_all_files_with_shebangs: true | |
| fail_level: error | |
| exclude: | | |
| "*/thirdparty/*" | |
| "./temp/*" | |
| NamingConventionCheck: | |
| needs: Docker | |
| runs-on: aks-linux-4-cores-16gb | |
| container: | |
| image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} | |
| volumes: | |
| - /mount:/mount | |
| options: --user 1001 # We use standard github-actions user inside container to avoid permission issues after checkout | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| timeout-minutes: 15 | |
| with: | |
| submodules: 'true' | |
| - 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 |