|
6 | 6 | # Change Logs: |
7 | 7 | # Date Author Notes |
8 | 8 | # 2023-07-01 Supperthomas the first version |
| 9 | +# 2024-09-06 Supperthomas add debug for action and add cppcheck for project |
9 | 10 | # |
10 | 11 | name: manual_scons_dist_trigger_only_one |
11 | 12 |
|
|
43 | 44 | required: true |
44 | 45 | type: boolean |
45 | 46 | default: false |
| 47 | + debug_flag: |
| 48 | + description: 'True to debug action, False not debug' |
| 49 | + required: true |
| 50 | + type: boolean |
| 51 | + default: false |
46 | 52 |
|
47 | 53 | permissions: |
48 | 54 | contents: read # to fetch code (actions/checkout) |
|
68 | 74 | git config --global http.postBuffer 524288000 |
69 | 75 | echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV |
70 | 76 | echo "RTT_CC=gcc" >> $GITHUB_ENV |
| 77 | + sudo apt-get -qq install cppcheck |
71 | 78 |
|
72 | 79 | - name: Install Arm ToolChains |
73 | 80 | if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-arm' && success() }} |
@@ -144,22 +151,28 @@ jobs: |
144 | 151 | RTT_BSP: ${{ github.event.inputs.bsp_options }} |
145 | 152 | RTT_TOOL_CHAIN: ${{ github.event.inputs.bsp_tool_chain}} |
146 | 153 | run: | |
147 | | - # source ~/.env/env.sh |
| 154 | + source ~/.env/env.sh |
148 | 155 | echo $RTT_BSP |
149 | 156 | ls bsp/$RTT_BSP/Kconfig && scons -C bsp/$RTT_BSP --pyconfig-silent |
150 | 157 | config=${{ github.event.inputs.bsp_config}} |
151 | 158 | echo "$config" |
152 | 159 | 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 |
153 | 162 | scons -C bsp/$RTT_BSP --pyconfig-silent |
154 | 163 | pushd bsp/$RTT_BSP && pkgs --update && popd |
155 | 164 | cat bsp/$RTT_BSP/.config |
156 | 165 | 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 |
162 | 168 | pwd |
| 169 | +
|
| 170 | + |
| 171 | + |
| 172 | + - name: Setup Debug Session |
| 173 | + if: ${{ github.event.inputs.debug_flag }} |
| 174 | + uses: csexton/debugger-action@master |
| 175 | + |
163 | 176 | - uses: actions/upload-artifact@v3 |
164 | 177 | if: ${{ github.event.inputs.dist_flag }} |
165 | 178 | with: |
|
0 commit comments