Skip to main content

Other CI Systems

If you're not using GitHub Actions or GitLab CI, you can integrate MemBrowse into any CI/CD pipeline using the CLI. Add the commands below to your existing build steps.

Prerequisites

  • MemBrowse CLI installed (pip install membrowse) — see CLI Reference for full installation details
  • ELF file output from your build
  • Linker script(s) defining memory regions (optional but recommended for accurate region tracking)
  • MemBrowse API key (from Project Settings)
  • Full git clone (not a shallow clone) — MemBrowse auto-detects commit metadata from the git history

Upload a Report

After your build step, run membrowse report with --upload:

membrowse report \
build/firmware.elf \
"linker.ld" \
--upload \
--target-name my-target \
--api-key $MEMBROWSE_API_KEY

MemBrowse auto-detects Git metadata (commit SHA, branch, author, etc.) from the git history. If your CI doesn't have the full history available, you can pass metadata explicitly — see the Git Metadata Options in the CLI Reference.

Multiple Linker Scripts

If your project uses multiple linker scripts, list them space-separated in quotes:

membrowse report \
build/firmware.elf \
"memory.ld sections.ld board.ld" \
--upload \
--target-name my-target \
--api-key $MEMBROWSE_API_KEY

Linker Variable Definitions

If your linker scripts use variables for memory sizes, pass them with --def:

membrowse report \
build/firmware.elf \
"linker.ld" \
--upload \
--target-name my-target \
--api-key $MEMBROWSE_API_KEY \
--def __flash_size__=512K \
--def __ram_size__=128K

Handling Budget Alerts

By default, membrowse report exits with code 1 when a budget alert is triggered, which will fail your CI pipeline. Use --dont-fail-on-alerts if you want uploads to succeed regardless:

membrowse report \
build/firmware.elf \
"linker.ld" \
--upload \
--target-name my-target \
--api-key $MEMBROWSE_API_KEY \
--dont-fail-on-alerts

Multiple Targets

If you build for different boards, build types, or feature variants, run membrowse report once per target:

# Build and analyze each target
make TARGET=stm32f4
membrowse report \
build/stm32f4/firmware.elf \
"boards/stm32f4/linker.ld" \
--upload \
--target-name stm32f4 \
--api-key $MEMBROWSE_API_KEY

make TARGET=nrf52840
membrowse report \
build/nrf52840/firmware.elf \
"boards/nrf52840/linker.ld boards/nrf52840/memory.ld" \
--upload \
--target-name nrf52840 \
--api-key $MEMBROWSE_API_KEY

Each target maintains its own independent history in the MemBrowse Portal.

PR Comments

The GitHub Actions integration posts PR comments automatically. For other CI systems, there are two approaches:

After uploading a report, use membrowse summary to fetch formatted per-target summaries from the API and post them as a PR comment:

# Upload the report first
membrowse report \
build/firmware.elf \
"linker.ld" \
--upload \
--target-name my-target \
--api-key $MEMBROWSE_API_KEY

# Fetch summary for the current commit
membrowse summary $COMMIT_SHA --api-key $MEMBROWSE_API_KEY

# Or get raw JSON for custom formatting
membrowse summary $COMMIT_SHA --api-key $MEMBROWSE_API_KEY --json

Option 2: --output-raw-response

Use --output-raw-response to get the upload response as JSON and post a comment yourself using your CI platform's API:

RESULT=$(membrowse report \
build/firmware.elf \
"linker.ld" \
--upload \
--target-name my-target \
--api-key $MEMBROWSE_API_KEY \
--output-raw-response)

# Extract diffs and alerts for your PR comment
echo "$RESULT" | jq '.diffs'
echo "$RESULT" | jq '.alerts'

The response JSON contains:

  • success: Whether the upload succeeded
  • report_id: The ID of the uploaded report
  • alerts: Any budget alerts triggered
  • diffs: Memory differences compared to the previous commit

Historical Onboarding

You can run membrowse onboard as a one-time CI job to populate historical data:

membrowse onboard \
50 \
"make clean && make all" \
build/firmware.elf \
my-target \
$MEMBROWSE_API_KEY \
--ld-scripts "linker.ld"

This requires a full git clone. The command checks out each historical commit, runs your build script, analyzes the ELF, and uploads the report. Commits that fail to build are skipped automatically.

Useful onboard options

  • --build-dirs src/ lib/ — Only rebuild when files in these directories changed. Commits with no relevant changes upload metadata-only reports, which speeds up onboarding significantly.
  • --initial-commit abc123 — Start processing from a specific commit hash instead of going back N commits from HEAD.
  • --commits "v1.0 v1.1 v2.0" — Process specific commits or tags instead of the last N commits. Use with --initial-parent to chain runs.
  • --binary-search — Minimize builds by only building where memory fingerprints differ between endpoints.
  • --dry-run — Verify the setup without uploading reports.
  • --def __flash_size__=512K — Pass linker variable definitions (same as membrowse report).

For all options, see the CLI Reference.