Skip to content

Commit 82f716d

Browse files
committed
Test Build Data collection
1 parent d5c5b1a commit 82f716d

File tree

2 files changed

+196
-11
lines changed

2 files changed

+196
-11
lines changed

.github/workflows/CubeMX-CI.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,145 @@ on:
1717
jobs:
1818
Build:
1919
runs-on: ubuntu-latest
20+
outputs:
21+
build_status: ${{ steps.build_step.outcome }}
22+
build_timestamp: ${{ steps.set_timestamp.outputs.timestamp }}
2023

2124
steps:
2225
- name: Checkout repo
2326
uses: actions/checkout@v4
2427

28+
- name: Set timestamp
29+
id: set_timestamp
30+
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
31+
2532
- name: Install tools
33+
id: install_tools
2634
uses: ARM-software/cmsis-actions/vcpkg@v1
2735
with:
2836
config: ".ci/vcpkg-configuration.json"
37+
continue-on-error: false
38+
39+
- name: Capture installation output
40+
if: always()
41+
run: |
42+
mkdir -p logs
43+
# Capture the vcpkg artifacts output
44+
echo "=== vcpkg Artifact Installation ===" > logs/vcpkg_install.log
45+
vcpkg x-update-registry --all 2>&1 | tee -a logs/vcpkg_install.log || true
46+
47+
- name: Save tool installation logs
48+
if: always()
49+
run: |
50+
mkdir -p logs
51+
echo "=== Tool Installation Information ===" > logs/install_tools.log
52+
echo "Timestamp: $(date -u +"%Y-%m-%d %H:%M:%S")" >> logs/install_tools.log
53+
echo "" >> logs/install_tools.log
54+
55+
# Capture only cmsis-toolbox from vcpkg list
56+
if command -v vcpkg &> /dev/null; then
57+
echo "=== CMSIS Toolbox ===" >> logs/install_tools.log
58+
echo "Full vcpkg list output:" >> logs/install_tools.log
59+
vcpkg list 2>&1 | tee -a logs/install_tools.log
60+
echo "" >> logs/install_tools.log
61+
echo "Filtered cmsis-toolbox:" >> logs/install_tools.log
62+
vcpkg list 2>&1 | grep "cmsis-toolbox" >> logs/install_tools.log || echo "cmsis-toolbox not found" >> logs/install_tools.log
63+
fi
64+
65+
- name: Upload tool logs
66+
if: always()
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: tool-logs
70+
path: logs/
2971

3072
- name: Activate Arm tool license
3173
uses: ARM-software/cmsis-actions/armlm@v1
3274

3375
- name: Build project with AC6
76+
id: build_step
3477
working-directory: ./CubeMX/
3578
run: cbuild CubeMX.csolution.yml --packs --toolchain AC6 --rebuild
79+
80+
CollectData:
81+
runs-on: ubuntu-latest
82+
needs: Build
83+
if: always()
84+
steps:
85+
- name: Download tool logs
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: tool-logs
89+
path: logs/
90+
91+
- name: Parse and collect data
92+
run: |
93+
# Parse tool installation log
94+
if [ -f logs/install_tools.log ]; then
95+
echo "Parsing tool installation log..."
96+
cat logs/install_tools.log
97+
else
98+
echo "No tool installation log found"
99+
fi
100+
101+
- name: Generate JSON report
102+
run: |
103+
cat << 'EOF' > collect_data.py
104+
import json
105+
import re
106+
from datetime import datetime
107+
108+
def parse_tool_log(log_path):
109+
cmsis_toolbox_info = None
110+
try:
111+
with open(log_path, 'r') as f:
112+
content = f.read()
113+
114+
# Parse vcpkg list format for cmsis-toolbox
115+
# Looking for line like: "arm:tools/open-cmsis-pack/cmsis-toolbox 2.12.0"
116+
match = re.search(r'arm:tools/open-cmsis-pack/cmsis-toolbox\s+(\S+)', content)
117+
if match:
118+
version = match.group(1)
119+
cmsis_toolbox_info = {
120+
"version": version,
121+
"full_name": "arm:tools/open-cmsis-pack/cmsis-toolbox"
122+
}
123+
124+
except FileNotFoundError:
125+
print("Tool log file not found")
126+
except Exception as e:
127+
print(f"Error parsing tool log: {e}")
128+
129+
return cmsis_toolbox_info
130+
131+
# Collect data
132+
data = {
133+
"workflow": "CubeMX: Test Build",
134+
"build_job": {
135+
"last_run": "${{ needs.Build.outputs.build_timestamp }}",
136+
"status": "${{ needs.Build.outputs.build_status }}",
137+
"passed": "${{ needs.Build.outputs.build_status }}" == "success"
138+
},
139+
"cmsis_toolbox": parse_tool_log("logs/install_tools.log")
140+
}
141+
142+
# Print JSON
143+
print(json.dumps(data, indent=2))
144+
145+
# Save to file
146+
with open('workflow_data.json', 'w') as f:
147+
json.dump(data, f, indent=2)
148+
EOF
149+
150+
python3 collect_data.py
151+
152+
- name: Display collected data
153+
run: |
154+
echo "=== Workflow Data Collection ==="
155+
cat workflow_data.json
156+
157+
- name: Upload workflow data
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: workflow-data
161+
path: workflow_data.json

.vscode/launch.json

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,89 @@
66
"type": "arm-debugger",
77
"request": "launch",
88
"programs": [
9-
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.axf",
10-
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.axf"
9+
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.axf",
10+
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.axf"
1111
],
1212
"programMode": "ram",
13-
// armdbg --cdb-list
1413
"cdbEntry": "Arm FVP::MPS2_Cortex_M33::Bare Metal Debug::Bare Metal Debug::Cortex-M33_0",
15-
"cdbEntryParams": {
16-
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
14+
"cdbEntryParams": {
15+
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
1716
}
1817
},
1918
{
2019
"name": "SimpleTZ (GCC/Clang)",
2120
"type": "arm-debugger",
2221
"request": "launch",
2322
"programs": [
24-
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.elf",
25-
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.elf"
23+
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.elf",
24+
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.elf"
2625
],
2726
"programMode": "ram",
28-
// armdbg --cdb-list
2927
"cdbEntry": "Arm FVP::MPS2_Cortex_M33::Bare Metal Debug::Bare Metal Debug::Cortex-M33_0",
30-
"cdbEntryParams": {
31-
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
28+
"cdbEntryParams": {
29+
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
30+
}
31+
},
32+
{
33+
"name": "STLink@pyOCD (launch)",
34+
"type": "gdbtarget",
35+
"request": "launch",
36+
"cwd": "${workspaceFolder}/CubeMX",
37+
"program": "out\\CubeMX\\MyBoard_ROM\\Debug\\CubeMX.axf",
38+
"gdb": "arm-none-eabi-gdb",
39+
"preLaunchTask": "CMSIS Load",
40+
"initCommands": [
41+
"monitor reset halt",
42+
"tbreak main"
43+
],
44+
"customResetCommands": [
45+
"monitor reset halt",
46+
"tbreak main",
47+
"continue"
48+
],
49+
"target": {
50+
"server": "pyocd",
51+
"serverParameters": [
52+
"gdbserver",
53+
"--probe",
54+
"stlink:",
55+
"--connect",
56+
"attach",
57+
"--cbuild-run",
58+
"${command:cmsis-csolution.getCbuildRunFile}",
59+
"--quiet",
60+
"--log",
61+
"*.cbuild_run,*server=info"
62+
],
63+
"port": "3333"
64+
},
65+
"cmsis": {
66+
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}",
67+
"updateConfiguration": "auto"
68+
}
69+
},
70+
{
71+
"name": "STLink@pyOCD (attach)",
72+
"type": "gdbtarget",
73+
"request": "attach",
74+
"cwd": "${workspaceFolder}/CubeMX",
75+
"program": "out\\CubeMX\\MyBoard_ROM\\Debug\\CubeMX.axf",
76+
"gdb": "arm-none-eabi-gdb",
77+
"initCommands": [
78+
""
79+
],
80+
"customResetCommands": [
81+
"monitor reset halt",
82+
"tbreak main",
83+
"continue"
84+
],
85+
"target": {
86+
"port": "3333"
87+
},
88+
"cmsis": {
89+
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}",
90+
"updateConfiguration": "auto"
3291
}
3392
}
3493
]
35-
}
94+
}

0 commit comments

Comments
 (0)