Skip to content

Commit effca75

Browse files
random commit
1 parent 8d4f939 commit effca75

File tree

8 files changed

+105
-27
lines changed

8 files changed

+105
-27
lines changed

.github/actions/build-step/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ runs:
7878
west build -b ${{ inputs.board }} \
7979
-d build \
8080
-p --sysbuild 2>&1 | tee ../../artifacts/build_output_${{ inputs.short_board }}.log
81+
if [[ "${{ inputs.short_board }}" == "thingy91x" ]]; then
82+
west build -d build/app -t rom_report
83+
west build -d build/app -t ram_report
84+
cp build/app/ro.json ../../artifacts/rom_report_${{ inputs.short_board }}
85+
cp build/app/ram.json ../../artifacts/ram_report_${{ inputs.short_board }}
86+
fi
8187
fi
8288
8389
- name: Copy artifacts

.github/workflows/build-and-target-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
secrets: inherit
5959
with:
6060
build_all: ${{ needs.setup.outputs.build_all == 'true' }}
61+
push_memory_badges: ${{ needs.setup.outputs.push_memory_badges == 'true' }}
6162
test:
6263
permissions:
6364
actions: read
@@ -71,4 +72,3 @@ jobs:
7172
artifact_run_id: ${{ needs.build.outputs.run_id }}
7273
devices: ${{ needs.setup.outputs.devices }}
7374
test_all: ${{ needs.setup.outputs.build_all == 'true' }}
74-
push_memory_badges: ${{ needs.setup.outputs.push_memory_badges == 'true' }}

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
type: boolean
1414
required: false
1515
default: false
16+
push_memory_badges:
17+
description: Whether to parse thingy91x build log and push memory badges
18+
type: boolean
19+
required: false
20+
default: false
1621
workflow_call:
1722
inputs:
1823
memfault_fw_type:
@@ -27,6 +32,10 @@ on:
2732
type: boolean
2833
required: false
2934
default: false
35+
push_memory_badges:
36+
type: boolean
37+
required: false
38+
default: false
3039
outputs:
3140
run_id:
3241
description: The run ID of the workflow to fetch artifacts from
@@ -131,6 +140,26 @@ jobs:
131140
version: ${{ env.VERSION }}
132141
path: asset-tracker-template/app
133142

143+
- name: Generate Memory Reports and Visualizations
144+
if: ${{ inputs.push_memory_badges }}
145+
continue-on-error: true
146+
working-directory: asset-tracker-template
147+
env:
148+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149+
run: |
150+
# Install required packages
151+
pip install pandas plotly --break-system-packages
152+
153+
# Generate sunburst charts first
154+
python3 scripts/sunburst_from_mem_report.py artifacts/rom_report_thingy91x
155+
python3 scripts/sunburst_from_mem_report.py artifacts/ram_report_thingy91x
156+
157+
# Generate badges, history plots, and push everything to gh-pages
158+
./tests/on_target/scripts/update_memory_badges.sh \
159+
artifacts/build_output_thingy91x.log \
160+
artifacts/rom_report_thingy91x.html \
161+
artifacts/ram_report_thingy91x.html
162+
134163
- name: Build (old) thingy91 firmware
135164
if: ${{ inputs.build_all }}
136165
uses: ./asset-tracker-template/.github/actions/build-step

.github/workflows/target-test.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ on:
2222
type: string
2323
required: true
2424
default: '[\"thingy91x\"]'
25-
push_memory_badges:
26-
type: boolean
27-
required: false
28-
default: false
29-
3025

3126
workflow_dispatch:
3227
inputs:
@@ -53,11 +48,6 @@ on:
5348
type: string
5449
required: true
5550
default: '[\"thingy91x\"]'
56-
push_memory_badges:
57-
description: Whether or not to parse thingy91x build log and push memory badges
58-
type: boolean
59-
required: false
60-
default: false
6151

6252
jobs:
6353
target_test:
@@ -125,14 +115,6 @@ jobs:
125115
--check-uploaded \
126116
asset-tracker-template-${{ inputs.artifact_fw_version }}-debug-${{ vars.DUT_DEVICE_TYPE }}-nrf91.elf
127117
128-
- name: Generate and Push RAM and FLASH Badges
129-
if: ${{ matrix.device == 'thingy91x' && inputs.push_memory_badges }}
130-
continue-on-error: true
131-
working-directory: asset-tracker-template
132-
env:
133-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
run: ./tests/on_target/scripts/update_memory_badges.sh tests/on_target/artifacts/build_output_thingy91x.log
135-
136118
- name: Target Tests
137119
working-directory: asset-tracker-template/tests/on_target
138120
run: |

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
[![Target_tests](https://github.com/nrfconnect/Asset-Tracker-Template/actions/workflows/build-and-target-test.yml/badge.svg?event=schedule)](https://github.com/nrfconnect/Asset-Tracker-Template/actions/workflows/build-and-target-test.yml?query=branch%3Amain+event%3Aschedule)
1010
[![Power Consumption Badge](https://img.shields.io/endpoint?url=https://nrfconnect.github.io/Asset-Tracker-Template/power_badge.json)](https://nrfconnect.github.io/Asset-Tracker-Template/power_measurements_plot.html)
1111

12-
[![RAM Usage thingy91x](https://img.shields.io/endpoint?url=https://nrfconnect.github.io/Asset-Tracker-Template/ram_badge.json)](https://nrfconnect.github.io/Asset-Tracker-Template/ram_history_plot.html)
13-
[![RAM Sunburst](https://img.shields.io/badge/🔗_RAM_Report-Sunburst_View-blue)](https://nrfconnect.github.io/Asset-Tracker-Template/ram_memory_sunburst.html)
14-
15-
[![FLASH Usage thingy91x](https://img.shields.io/endpoint?url=https://nrfconnect.github.io/Asset-Tracker-Template/flash_badge.json)](https://nrfconnect.github.io/Asset-Tracker-Template/flash_history_plot.html)
16-
[![FLASH Sunburst](https://img.shields.io/badge/🔗_FLASH_Report-Sunburst_View-blue)](https://nrfconnect.github.io/Asset-Tracker-Template/rom_memory_sunburst.html)
12+
[![RAM Usage thingy91x](https://img.shields.io/endpoint?url=https://nrfconnect.github.io/Asset-Tracker-Template/ram_badge.json)](https://nrfconnect.github.io/Asset-Tracker-Template/ram_memory_view.html)
13+
[![FLASH Usage thingy91x](https://img.shields.io/endpoint?url=https://nrfconnect.github.io/Asset-Tracker-Template/flash_badge.json)](https://nrfconnect.github.io/Asset-Tracker-Template/flash_memory_view.html)
1714

1815
## Overview
1916

tests/on_target/scripts/update_memory_badges.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
# Define paths
44
BUILD_LOG=$1
5+
ROM_REPORT=$2
6+
RAM_REPORT=$3
57

68
FLASH_BADGE_FILE_DEST=docs/flash_badge.json
79
RAM_BADGE_FILE_DEST=docs/ram_badge.json
810
FLASH_HISTORY_CSV_DEST=docs/flash_history.csv
911
RAM_HISTORY_CSV_DEST=docs/ram_history.csv
1012
FLASH_PLOT_HTML_DEST=docs/flash_history_plot.html
1113
RAM_PLOT_HTML_DEST=docs/ram_history_plot.html
14+
ROM_REPORT_DEST=docs/rom_report_thingy91x.html
15+
RAM_REPORT_DEST=docs/ram_report_thingy91x.html
1216

13-
if [ -z "$BUILD_LOG" ]; then
14-
echo "Error: Build log file path not provided"
17+
if [ -z "$BUILD_LOG" ] || [ -z "$ROM_REPORT" ] || [ -z "$RAM_REPORT" ]; then
18+
echo "Error: Missing required arguments"
19+
echo "Usage: $0 <build_log> <rom_report> <ram_report>"
1520
exit 0
1621
fi
1722

@@ -62,10 +67,13 @@ mkdir -p docs
6267
cp "$TEMP_DIR"/*.json docs/
6368
cp "$TEMP_DIR"/*.csv docs/
6469
cp "$TEMP_DIR"/*.html docs/
70+
cp "$ROM_REPORT" "$ROM_REPORT_DEST"
71+
cp "$RAM_REPORT" "$RAM_REPORT_DEST"
6572

6673
git add $FLASH_BADGE_FILE_DEST $RAM_BADGE_FILE_DEST \
6774
$FLASH_HISTORY_CSV_DEST $RAM_HISTORY_CSV_DEST \
68-
$FLASH_PLOT_HTML_DEST $RAM_PLOT_HTML_DEST
75+
$FLASH_PLOT_HTML_DEST $RAM_PLOT_HTML_DEST \
76+
$ROM_REPORT_DEST $RAM_REPORT_DEST
6977
git commit -m "Update memory usage badges"
7078
git push origin gh-pages
7179

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>FLASH Memory Dashboard</title>
6+
<style>
7+
body, html {
8+
margin: 0;
9+
padding: 0;
10+
height: 100%;
11+
}
12+
.container {
13+
display: flex;
14+
height: 100%;
15+
}
16+
.pane {
17+
flex: 1;
18+
border: none;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<div class="container">
24+
<iframe class="pane" src="flash_history_plot.html"></iframe>
25+
<iframe class="pane" src="rom_report_thingy91x.html"></iframe>
26+
</div>
27+
</body>
28+
</html>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>RAM Memory Dashboard</title>
6+
<style>
7+
body, html {
8+
margin: 0;
9+
padding: 0;
10+
height: 100%;
11+
}
12+
.container {
13+
display: flex;
14+
height: 100%;
15+
}
16+
.pane {
17+
flex: 1;
18+
border: none;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<div class="container">
24+
<iframe class="pane" src="ram_history_plot.html"></iframe>
25+
<iframe class="pane" src="ram_report_thingy91x.html"></iframe>
26+
</div>
27+
</body>
28+
</html>

0 commit comments

Comments
 (0)