Multiple Targets
Track memory across different boards, build types, or feature variants. Each target maintains its own independent history in the MemBrowse Portal.
Examples of targets:
- Different boards:
stm32f4,nrf52840,esp32 - Build types:
debug,release - Feature variants:
with-bluetooth,minimal
Setup
Create a separate analysis job for each target and a single comment job that collects all reports:
include:
- project: 'membrowse/gitlab-ci'
ref: v1
file: '/membrowse.yml'
stages:
- build
- test
- deploy
build:
stage: build
image: gcc:latest
script:
- make build-all
artifacts:
paths:
- build/
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS == null
# Target 1: STM32F4
membrowse-stm32:
extends: .membrowse-analyze
stage: test
variables:
MEMBROWSE_ELF: build/stm32f4.elf
MEMBROWSE_LD: "stm32f4.ld"
MEMBROWSE_TARGET_NAME: stm32f4
needs:
- build
# Target 2: ESP32
membrowse-esp32:
extends: .membrowse-analyze
stage: test
variables:
MEMBROWSE_ELF: build/esp32.elf
MEMBROWSE_TARGET_NAME: esp32
needs:
- build
# Combined MR comment for all targets
membrowse-comment:
extends: .membrowse-comment
stage: deploy
needs:
- membrowse-stm32
- membrowse-esp32
The analysis jobs run in parallel. The comment job collects all *.json files from the report directory and posts a single combined MR comment covering all targets.
How It Works
Each .membrowse-analyze job saves its JSON report to the shared MEMBROWSE_REPORT_DIR (default: .membrowse). The file is named membrowse_<target_name>.json. When the comment job runs, it picks up all report files via artifact dependencies from needs:.
List all analysis jobs in the comment job's needs: to ensure all reports are available before the comment is posted.
Budget Alerts with Multiple Targets
Budget alert failures are deferred to the comment job. If any target triggers an alert, the comment is posted first, then the comment job fails the pipeline. The failure message identifies which target(s) triggered alerts.
To ignore alerts for a specific target, set MEMBROWSE_DONT_FAIL_ON_ALERTS: "true" on that target's analysis job:
membrowse-esp32:
extends: .membrowse-analyze
stage: test
variables:
MEMBROWSE_ELF: build/esp32.elf
MEMBROWSE_TARGET_NAME: esp32
MEMBROWSE_DONT_FAIL_ON_ALERTS: "true"
needs:
- build