Skip to content

Commit 0c16568

Browse files
supperthomasmysterywolf
authored andcommitted
[action] add cppcheck project and action debug
1 parent 6fc1fc7 commit 0c16568

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

Diff for: .github/workflows/manual_dist.yml

+19-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Change Logs:
77
# Date Author Notes
88
# 2023-07-01 Supperthomas the first version
9+
# 2024-09-06 Supperthomas add debug for action and add cppcheck for project
910
#
1011
name: manual_scons_dist_trigger_only_one
1112

@@ -43,6 +44,11 @@ on:
4344
required: true
4445
type: boolean
4546
default: false
47+
debug_flag:
48+
description: 'True to debug action, False not debug'
49+
required: true
50+
type: boolean
51+
default: false
4652

4753
permissions:
4854
contents: read # to fetch code (actions/checkout)
@@ -68,6 +74,7 @@ jobs:
6874
git config --global http.postBuffer 524288000
6975
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
7076
echo "RTT_CC=gcc" >> $GITHUB_ENV
77+
sudo apt-get -qq install cppcheck
7178
7279
- name: Install Arm ToolChains
7380
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-arm' && success() }}
@@ -144,22 +151,28 @@ jobs:
144151
RTT_BSP: ${{ github.event.inputs.bsp_options }}
145152
RTT_TOOL_CHAIN: ${{ github.event.inputs.bsp_tool_chain}}
146153
run: |
147-
# source ~/.env/env.sh
154+
source ~/.env/env.sh
148155
echo $RTT_BSP
149156
ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent
150157
config=${{ github.event.inputs.bsp_config}}
151158
echo "$config"
152159
echo "$config" >> bsp/$RTT_BSP/.config
160+
insert_code="env.Tool('compilation_db')\nenv.CompilationDatabase()\n"
161+
sed -i "/DoBuilding(TARGET, objs)/i $insert_code" bsp/$RTT_BSP/SConstruct
153162
scons -C bsp/$RTT_BSP --pyconfig-silent
154163
pushd bsp/$RTT_BSP && pkgs --update && popd
155164
cat bsp/$RTT_BSP/.config
156165
scons -C bsp/$RTT_BSP -j$(nproc)
157-
mkdir -p ${{ github.workspace }}/$RTT_BSP
158-
cp -r bsp/$RTT_BSP ${{ github.workspace }}/$RTT_BSP/
159-
scons --dist -C bsp/$RTT_BSP
160-
cp bsp/$RTT_BSP/dist/project.zip ${{ github.workspace }}/$RTT_BSP/
161-
ls bsp/$RTT_BSP/dist
166+
ls bsp/$RTT_BSP
167+
cppcheck --project=bsp/$RTT_BSP/compile_commands.json
162168
pwd
169+
170+
171+
172+
- name: Setup Debug Session
173+
if: ${{ github.event.inputs.debug_flag }}
174+
uses: csexton/debugger-action@master
175+
163176
- uses: actions/upload-artifact@v3
164177
if: ${{ github.event.inputs.dist_flag }}
165178
with:

0 commit comments

Comments
 (0)