From 082885131362516b745616d152cf93e7eac85531 Mon Sep 17 00:00:00 2001 From: sudlud Date: Wed, 25 Dec 2024 22:46:45 +0100 Subject: [PATCH] feat(CI/linux-build): introduce option to set maxerrors for compilation (#21022) --- .github/actions/linux-build/action.yml | 9 +++++++-- .github/workflows/core_modules_build.yml | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/linux-build/action.yml b/.github/actions/linux-build/action.yml index 132cfc9fa4aa31..caf3c6047ebc43 100644 --- a/.github/actions/linux-build/action.yml +++ b/.github/actions/linux-build/action.yml @@ -26,6 +26,11 @@ inputs: description: Flag to enable or disable PCH required: false type: boolean + maxerrors: + default: 1 + description: Max allowed error count before compilation stops + required: false + type: number runs: using: composite steps: @@ -106,8 +111,8 @@ runs: -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_C_FLAGS="-Werror" \ - -DCMAKE_CXX_FLAGS="-Werror" \ + -DCMAKE_C_FLAGS="-Werror ${{ startsWith(inputs.cc, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} " \ + -DCMAKE_CXX_FLAGS="-Werror ${{ startsWith(inputs.cxx, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}}" \ -DBUILD_TESTING="ON" \ -DUSE_SCRIPTPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ -DUSE_COREPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ diff --git a/.github/workflows/core_modules_build.yml b/.github/workflows/core_modules_build.yml index e67614ebe5bb85..38d930cec641fb 100644 --- a/.github/workflows/core_modules_build.yml +++ b/.github/workflows/core_modules_build.yml @@ -49,3 +49,4 @@ jobs: CXX: ${{ matrix.compiler.CXX }} modules: true pch: false + maxerrors: 0