From 3fb09ecef35e2272005cd34678eb17cae33ed27c Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Thu, 9 Oct 2025 09:05:24 +0200 Subject: [PATCH 01/15] Switch code style checks to use Docker environment --- .../ubuntu_22_04_x64_code_style/Dockerfile | 18 +++ .../ubuntu_24_04_x64_code_style/Dockerfile | 20 +++ .github/workflows/code_style.yml | 143 +++++++++++------- 3 files changed, 126 insertions(+), 55 deletions(-) create mode 100644 .github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile create mode 100644 .github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile diff --git a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile new file mode 100644 index 00000000000000..6fd5e5dbcd6bcb --- /dev/null +++ b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile @@ -0,0 +1,18 @@ +ARG REGISTRY="docker.io" +FROM ${REGISTRY}/library/ubuntu:22.04 + +USER root + +# APT configuration +RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ + echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \ + echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \ + echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf + +ENV DEBIAN_FRONTEND="noninteractive" \ + TZ="Europe/London" + +RUN apt update && \ + apt install wget git curl cmake build-essential && \ + apt --assume-yes install shellcheck && \ + apt --assume-yes install clang-14 libclang-14-dev diff --git a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile new file mode 100644 index 00000000000000..9487d04a2a2283 --- /dev/null +++ b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile @@ -0,0 +1,20 @@ +ARG REGISTRY="docker.io" +FROM ${REGISTRY}/library/ubuntu:24.04 + +USER root + +# APT configuration +RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ + echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \ + echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \ + echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf + +ENV DEBIAN_FRONTEND="noninteractive" \ + TZ="Europe/London" + +RUN apt update && \ + apt install wget git curl cmake lsb-release software-properties-common gnupg build-essential && \ + wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh 18 && \ + apt --assume-yes install binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu scons gcc-riscv64-linux-gnu g++-riscv64-linux-gnu binutils-riscv64-linux-gnu diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 327a63d68e5fe1..a694da5b0d9565 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -8,28 +8,79 @@ concurrency: permissions: read-all jobs: + Smart_CI: + runs-on: ubuntu-latest + 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: - runs-on: ubuntu-24.04 - if: ${{ github.repository_owner == 'openvinotoolkit' }} - permissions: - pull-requests: write + 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 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Install clang-format-18 - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 18 - # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -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=ON -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -B build + run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -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 @@ -44,23 +95,18 @@ jobs: filter_mode: nofilter clang-format-aarch64: - runs-on: ubuntu-24.04 - if: ${{ github.repository_owner == 'openvinotoolkit' }} - permissions: - pull-requests: write + 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 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + timeout-minutes: 15 with: submodules: 'true' - - name: Install clang-format-18 and cross-compilation dependencies - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 18 - sudo apt update - sudo apt --assume-yes install binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu scons - # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation @@ -80,25 +126,17 @@ jobs: filter_mode: nofilter clang-format-riscv64: - runs-on: ubuntu-24.04 - if: ${{ github.repository_owner == 'openvinotoolkit' }} - permissions: - pull-requests: write + 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 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + timeout-minutes: 15 with: submodules: 'true' - - - name: Install clang-format-18 and cross-compilation dependencies - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 18 - sudo apt update - sudo apt --assume-yes install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu binutils-riscv64-linux-gnu - - # Run cmake with extra options to cover as much source code as possible: - # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector - name: CMake configure run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64 @@ -115,21 +153,18 @@ jobs: filter_mode: nofilter ShellCheck: - runs-on: ubuntu-22.04 - if: ${{ github.repository_owner == 'openvinotoolkit' }} - permissions: - pull-requests: write + 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 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Install ShellCheck - run: | - sudo apt update - sudo apt --assume-yes install shellcheck - - name: CMake configure run: cmake -B build @@ -150,20 +185,18 @@ jobs: "./temp/*" NamingConventionCheck: - runs-on: ubuntu-22.04 - if: ${{ github.repository_owner == 'openvinotoolkit' }} + 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 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 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 From 42241e107499a5217fc8b1e7410d14cb6eb3a1ca Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Thu, 9 Oct 2025 09:20:58 +0200 Subject: [PATCH 02/15] update docker_tag with my PR ID --- .github/dockerfiles/docker_tag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tag index 47264d2113504d..2fbbf3a952f2a7 100644 --- a/.github/dockerfiles/docker_tag +++ b/.github/dockerfiles/docker_tag @@ -1 +1 @@ -pr-32079 \ No newline at end of file +pr-32342 \ No newline at end of file From 8c1ba13f9162ad8443c8b1536bbc4bf036b26ffc Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Thu, 9 Oct 2025 11:48:37 +0200 Subject: [PATCH 03/15] Add clang-format-18 to the docker image --- .../dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile | 2 +- .../dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile index 6fd5e5dbcd6bcb..830902ff59a38e 100644 --- a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile @@ -13,6 +13,6 @@ ENV DEBIAN_FRONTEND="noninteractive" \ TZ="Europe/London" RUN apt update && \ - apt install wget git curl cmake build-essential && \ + apt install wget git curl cmake build-essential python3-pip && \ apt --assume-yes install shellcheck && \ apt --assume-yes install clang-14 libclang-14-dev diff --git a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile index 9487d04a2a2283..af853fa3f63260 100644 --- a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile @@ -13,7 +13,7 @@ ENV DEBIAN_FRONTEND="noninteractive" \ TZ="Europe/London" RUN apt update && \ - apt install wget git curl cmake lsb-release software-properties-common gnupg build-essential && \ + apt install wget git curl cmake lsb-release software-properties-common gnupg build-essential clang-format-18 && \ wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ ./llvm.sh 18 && \ From 631cc37bdbb9311e44dab6a605a74844f2df3fc6 Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Thu, 9 Oct 2025 13:02:56 +0200 Subject: [PATCH 04/15] Add install shellcheck to docker image --- .../ubuntu_24_04_x64_code_style/Dockerfile | 2 +- .github/workflows/code_style.yml | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile index af853fa3f63260..725fd6fb9553b4 100644 --- a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile @@ -13,7 +13,7 @@ ENV DEBIAN_FRONTEND="noninteractive" \ TZ="Europe/London" RUN apt update && \ - apt install wget git curl cmake lsb-release software-properties-common gnupg build-essential clang-format-18 && \ + apt install wget git curl cmake lsb-release software-properties-common gnupg build-essential clang-format-18 shellcheck && \ wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ ./llvm.sh 18 && \ diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index a694da5b0d9565..c3e3827483bff3 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -70,11 +70,15 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount + - ${{ github.workspace }}:${{ github.workspace }} + env: + OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' + path: ${{ env.OPENVINO_REPO }} # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector @@ -101,11 +105,15 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount + - ${{ github.workspace }}:${{ github.workspace }} + env: + OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' + path: ${{ env.OPENVINO_REPO }} # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector @@ -132,11 +140,16 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount + - ${{ github.workspace }}:${{ github.workspace }} + env: + OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' + path: ${{ env.OPENVINO_REPO }} + - name: CMake configure run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64 @@ -159,11 +172,15 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount + - ${{ github.workspace }}:${{ github.workspace }} + env: + OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' + path: ${{ env.OPENVINO_REPO }} - name: CMake configure run: cmake -B build @@ -191,11 +208,15 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount + - ${{ github.workspace }}:${{ github.workspace }} + env: + OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' + path: ${{ env.OPENVINO_REPO }} - name: Install Python-based dependencies run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt From d2ca574226bae7094ad72a534a4d7fdfbf7b5cec Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 10 Oct 2025 09:40:17 +0200 Subject: [PATCH 05/15] update docker files with newest version of git --- .../ubuntu_22_04_x64_code_style/Dockerfile | 21 +++++++++++++++---- .../ubuntu_24_04_x64_code_style/Dockerfile | 21 ++++++++++++++++--- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile index 830902ff59a38e..578c466d1c05b8 100644 --- a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile @@ -12,7 +12,20 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ ENV DEBIAN_FRONTEND="noninteractive" \ TZ="Europe/London" -RUN apt update && \ - apt install wget git curl cmake build-essential python3-pip && \ - apt --assume-yes install shellcheck && \ - apt --assume-yes install clang-14 libclang-14-dev +RUN apt-get update && \ + apt-get install software-properties-common && \ + add-apt-repository --yes --no-update ppa:git-core/ppa && \ + apt-get update && \ + apt-get install \ + curl \ + git \ + ca-certificates \ + cmake \ + wget \ + build-essential \ + python3-pip \ + shellcheck \ + clang-14 \ + libclang-14-dev \ + && \ + rm -rf /var/lib/apt/lists/* diff --git a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile index 725fd6fb9553b4..4461fee0093b72 100644 --- a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile @@ -12,9 +12,24 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ ENV DEBIAN_FRONTEND="noninteractive" \ TZ="Europe/London" -RUN apt update && \ - apt install wget git curl cmake lsb-release software-properties-common gnupg build-essential clang-format-18 shellcheck && \ +RUN apt-get update && \ + apt-get install software-properties-common && \ + add-apt-repository --yes --no-update ppa:git-core/ppa && \ + apt-get update && \ + apt-get install \ + curl \ + git \ + ca-certificates \ + wget \ + cmake \ + lsb-release \ + gnupg \ + build-essential \ + clang-format-18 \ + shellcheck \ + && \ wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ ./llvm.sh 18 && \ - apt --assume-yes install binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu scons gcc-riscv64-linux-gnu g++-riscv64-linux-gnu binutils-riscv64-linux-gnu + apt-get --assume-yes install binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu scons gcc-riscv64-linux-gnu g++-riscv64-linux-gnu binutils-riscv64-linux-gnu && \ + rm -rf /var/lib/apt/lists/* From f5dcd55e05d97b37c67cad3100bf1fd0b7864927 Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 10 Oct 2025 09:40:41 +0200 Subject: [PATCH 06/15] use path with action checkout --- .github/workflows/code_style.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index c3e3827483bff3..a4f374fa404807 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -70,7 +70,6 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - - ${{ github.workspace }}:${{ github.workspace }} env: OPENVINO_REPO: ${{ github.workspace }}/openvino steps: @@ -105,7 +104,6 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - - ${{ github.workspace }}:${{ github.workspace }} env: OPENVINO_REPO: ${{ github.workspace }}/openvino steps: @@ -140,7 +138,6 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - - ${{ github.workspace }}:${{ github.workspace }} env: OPENVINO_REPO: ${{ github.workspace }}/openvino steps: @@ -172,7 +169,6 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount - - ${{ github.workspace }}:${{ github.workspace }} env: OPENVINO_REPO: ${{ github.workspace }}/openvino steps: @@ -208,7 +204,6 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount - - ${{ github.workspace }}:${{ github.workspace }} env: OPENVINO_REPO: ${{ github.workspace }}/openvino steps: From 5e08453cd05717ae6eab585194d787feabfcbbcc Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 10 Oct 2025 12:00:48 +0200 Subject: [PATCH 07/15] delete path from action checkout --- .github/workflows/code_style.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index a4f374fa404807..1973651435de3c 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -70,14 +70,11 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - env: - OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - path: ${{ env.OPENVINO_REPO }} # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector @@ -104,14 +101,11 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - env: - OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - path: ${{ env.OPENVINO_REPO }} # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector @@ -138,14 +132,11 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - env: - OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - path: ${{ env.OPENVINO_REPO }} - name: CMake configure run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64 @@ -169,14 +160,11 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount - env: - OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - path: ${{ env.OPENVINO_REPO }} - name: CMake configure run: cmake -B build @@ -204,14 +192,11 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount - env: - OPENVINO_REPO: ${{ github.workspace }}/openvino steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - path: ${{ env.OPENVINO_REPO }} - name: Install Python-based dependencies run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt From 41ddbf439294b9e86bf68a11b011d5df91da0349 Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 10 Oct 2025 12:15:33 +0200 Subject: [PATCH 08/15] try to add git safe directory manually --- .github/workflows/code_style.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 1973651435de3c..c9ca65b02edf1f 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -76,6 +76,10 @@ jobs: with: submodules: 'true' + - name: Fix git config safe directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation @@ -107,6 +111,10 @@ jobs: with: submodules: 'true' + - name: Fix git config safe directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation @@ -138,6 +146,10 @@ jobs: with: submodules: 'true' + - name: Fix git config safe directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + - name: CMake configure run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64 From ba7284df4352f3a410cc73cbe53d71f685b16ad4 Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Mon, 13 Oct 2025 11:03:25 +0200 Subject: [PATCH 09/15] install python requirements for code style directly in docker image --- .dockerignore | 1 + .../ov_test/ubuntu_22_04_x64_code_style/Dockerfile | 11 ++++++++++- .github/labeler.yml | 1 + .github/workflows/code_style.yml | 11 ++++++++--- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index dc2137f024b9fc..e232b7f406d15f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ * !install_build_dependencies.sh !scripts/install_dependencies/install_openvino_dependencies.sh +!cmake/developer_package/ncc_naming_style/requirements_dev.txt diff --git a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile index 578c466d1c05b8..97f7e714f01386 100644 --- a/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_22_04_x64_code_style/Dockerfile @@ -23,9 +23,18 @@ RUN apt-get update && \ cmake \ wget \ build-essential \ - python3-pip \ shellcheck \ clang-14 \ libclang-14-dev \ && \ rm -rf /var/lib/apt/lists/* + +ENV PIP_VERSION="24.0" +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \ + rm -f get-pip.py + +ADD cmake/developer_package/ncc_naming_style/requirements_dev.txt /requirements_dev.txt + +RUN pip3 install --no-cache-dir -r /requirements_dev.txt && \ + rm -f /requirements_dev.txt diff --git a/.github/labeler.yml b/.github/labeler.yml index 00a3ca40bc24c9..b86f1ef420c389 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -200,6 +200,7 @@ - 'install_build_dependencies.sh' - '**/install_openvino_dependencies.sh' - '.github/actions/handle_docker/**/*' +- 'cmake/developer_package/ncc_naming_style/requirements_dev.txt' 'category: dockerfiles': - '.github/dockerfiles/**/*' diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index c9ca65b02edf1f..bf3bb78caa631e 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -84,7 +84,7 @@ jobs: # - -DENABLE_PROFILING_ITT=ON -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=ON -DSELECTIVE_BUILD=COLLECT -DENABLE_SNIPPETS_LIBXSMM_TPP=ON -B build + run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -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 @@ -178,6 +178,10 @@ jobs: with: submodules: 'true' + - name: Fix git config safe directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + - name: CMake configure run: cmake -B build @@ -210,8 +214,9 @@ jobs: with: submodules: 'true' - - name: Install Python-based dependencies - run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt + - name: Fix git config safe directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE - name: CMake configure run: cmake -B build From 931c0854cc8dd1b953ee846172c90071073e425c Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Mon, 13 Oct 2025 11:33:31 +0200 Subject: [PATCH 10/15] update ubuntu24 code style dockerfile to contain python3-dev --- .../dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile index 4461fee0093b72..1240f00fc20b82 100644 --- a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile @@ -27,6 +27,8 @@ RUN apt-get update && \ build-essential \ clang-format-18 \ shellcheck \ + python3-dev \ + python3-distutils \ && \ wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ From 7af63560219ab6d584f52dbd0c57fb6ecd6513d5 Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Mon, 13 Oct 2025 11:49:02 +0200 Subject: [PATCH 11/15] use python3-setuptools --- .../dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile index 1240f00fc20b82..65fbc30e098e81 100644 --- a/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile +++ b/.github/dockerfiles/ov_test/ubuntu_24_04_x64_code_style/Dockerfile @@ -28,7 +28,8 @@ RUN apt-get update && \ clang-format-18 \ shellcheck \ python3-dev \ - python3-distutils \ + python3-setuptools \ + python3-pip \ && \ wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ From c6f566622db31f07c44d5e573d8f6c5e6e0ea29e Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 17 Oct 2025 11:10:44 +0200 Subject: [PATCH 12/15] try to avoid extra step by adding env variables --- .github/workflows/code_style.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index bf3bb78caa631e..36a96009365cb2 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -70,15 +70,19 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount + env: + GITHUB_WORKSPACE: '/__w/openvino/openvino' + OPENVINO_REPO: /__w/openvino/openvino/openvino + BUILD_DIR: /__w/openvino/openvino/openvino_build steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Fix git config safe directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE + # - name: Fix git config safe directory + # run: | + # git config --global --add safe.directory $GITHUB_WORKSPACE # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector From ed91951315af7b3922dabceebb5f05cb90db819e Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 17 Oct 2025 11:31:12 +0200 Subject: [PATCH 13/15] try using different user to run the checkout --- .github/workflows/code_style.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 36a96009365cb2..71f2bd645eccbe 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -70,10 +70,7 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - env: - GITHUB_WORKSPACE: '/__w/openvino/openvino' - OPENVINO_REPO: /__w/openvino/openvino/openvino - BUILD_DIR: /__w/openvino/openvino/openvino_build + options: --user 1001 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 From c4523d79cd21fee8607e84392978c84c64fb320d Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 17 Oct 2025 11:45:45 +0200 Subject: [PATCH 14/15] use different user to run checkout on every code style job --- .github/workflows/code_style.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 71f2bd645eccbe..045d854775e352 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -77,10 +77,6 @@ jobs: with: submodules: 'true' - # - name: Fix git config safe directory - # run: | - # git config --global --add safe.directory $GITHUB_WORKSPACE - # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation @@ -106,16 +102,13 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount + options: --user 1001 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Fix git config safe directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - # Run cmake with extra options to cover as much source code as possible: # - -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT to enable codestyle check for ITT collector # - -DENABLE_SNIPPETS_LIBXSMM_TPP to cover snippets TPP adaptation @@ -141,16 +134,13 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount + options: --user 1001 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Fix git config safe directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - - name: CMake configure run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64.linux.toolchain.cmake -B build_riscv64 @@ -173,16 +163,13 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount + options: --user 1001 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Fix git config safe directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - - name: CMake configure run: cmake -B build @@ -209,16 +196,13 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount + options: --user 1001 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 timeout-minutes: 15 with: submodules: 'true' - - name: Fix git config safe directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - - name: CMake configure run: cmake -B build From 6f442b5047954f687f13c13365bf0819a05c024d Mon Sep 17 00:00:00 2001 From: "Koscinski, Gracjan" Date: Fri, 17 Oct 2025 12:38:13 +0200 Subject: [PATCH 15/15] add comments --- .github/workflows/code_style.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 045d854775e352..a14311fb32d9c6 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -70,7 +70,7 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - options: --user 1001 + 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 @@ -102,7 +102,7 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - options: --user 1001 + 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 @@ -134,7 +134,7 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64_code_style }} volumes: - /mount:/mount - options: --user 1001 + 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 @@ -163,7 +163,7 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount - options: --user 1001 + 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 @@ -196,7 +196,7 @@ jobs: image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }} volumes: - /mount:/mount - options: --user 1001 + 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