From 0c16568387db1b75690198862ceda7314b6a881c Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Fri, 6 Sep 2024 08:26:56 +0800 Subject: [PATCH] [action] add cppcheck project and action debug --- .github/workflows/manual_dist.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/manual_dist.yml b/.github/workflows/manual_dist.yml index ea5fd1eb495..aca8f09923c 100644 --- a/.github/workflows/manual_dist.yml +++ b/.github/workflows/manual_dist.yml @@ -6,6 +6,7 @@ # Change Logs: # Date Author Notes # 2023-07-01 Supperthomas the first version +# 2024-09-06 Supperthomas add debug for action and add cppcheck for project # name: manual_scons_dist_trigger_only_one @@ -43,6 +44,11 @@ on: required: true type: boolean default: false + debug_flag: + description: 'True to debug action, False not debug' + required: true + type: boolean + default: false permissions: contents: read # to fetch code (actions/checkout) @@ -68,6 +74,7 @@ jobs: git config --global http.postBuffer 524288000 echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV echo "RTT_CC=gcc" >> $GITHUB_ENV + sudo apt-get -qq install cppcheck - name: Install Arm ToolChains if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-arm' && success() }} @@ -144,22 +151,28 @@ jobs: RTT_BSP: ${{ github.event.inputs.bsp_options }} RTT_TOOL_CHAIN: ${{ github.event.inputs.bsp_tool_chain}} run: | - # source ~/.env/env.sh + source ~/.env/env.sh echo $RTT_BSP ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent config=${{ github.event.inputs.bsp_config}} echo "$config" echo "$config" >> bsp/$RTT_BSP/.config + insert_code="env.Tool('compilation_db')\nenv.CompilationDatabase()\n" + sed -i "/DoBuilding(TARGET, objs)/i $insert_code" bsp/$RTT_BSP/SConstruct scons -C bsp/$RTT_BSP --pyconfig-silent pushd bsp/$RTT_BSP && pkgs --update && popd cat bsp/$RTT_BSP/.config scons -C bsp/$RTT_BSP -j$(nproc) - mkdir -p ${{ github.workspace }}/$RTT_BSP - cp -r bsp/$RTT_BSP ${{ github.workspace }}/$RTT_BSP/ - scons --dist -C bsp/$RTT_BSP - cp bsp/$RTT_BSP/dist/project.zip ${{ github.workspace }}/$RTT_BSP/ - ls bsp/$RTT_BSP/dist + ls bsp/$RTT_BSP + cppcheck --project=bsp/$RTT_BSP/compile_commands.json pwd + + + + - name: Setup Debug Session + if: ${{ github.event.inputs.debug_flag }} + uses: csexton/debugger-action@master + - uses: actions/upload-artifact@v3 if: ${{ github.event.inputs.dist_flag }} with: