Skip to content

Commit e5f6b14

Browse files
Trond-F-Christiansenbjda
authored andcommitted
ci: unify memfault versioning across build and release pipelines
unify the way the Memfault firmware version and type are set between manual builds and the CI pipelines. Signed-off-by: Trond F. Christiansen <trond.christiansen@nordicsemi.no>
1 parent a623ebb commit e5f6b14

File tree

10 files changed

+23
-40
lines changed

10 files changed

+23
-40
lines changed

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ inputs:
55
type: string
66
required: false
77
default: "fookey"
8-
memfault_fw_type:
9-
type: string
10-
required: false
11-
default: "att-dev"
12-
memfault_fw_version_prefix:
13-
type: string
8+
memfault_release:
9+
type: boolean
1410
required: false
15-
default: "0.0.0-dev"
11+
default: false
1612
board:
1713
type: string
1814
required: true
@@ -68,9 +64,9 @@ runs:
6864
cp overlay-memfault.conf overlay-debug-att.conf
6965
cat overlay-upload-modem-traces-to-memfault.conf >> overlay-debug-att.conf
7066
echo CONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${{ inputs.memfault_project_key }}\" >> overlay-debug-att.conf
71-
echo CONFIG_MEMFAULT_NCS_FW_VERSION_AUTO=y >> overlay-debug-att.conf
72-
echo CONFIG_MEMFAULT_NCS_FW_VERSION_PREFIX=\"${{ inputs.memfault_fw_version_prefix }}+\" >> overlay-debug-att.conf
73-
echo CONFIG_MEMFAULT_NCS_FW_TYPE=\"${{ inputs.memfault_fw_type }}\" >> overlay-debug-att.conf
67+
if [[ "${{ inputs.memfault_release }}" == "true" ]]; then
68+
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-debug-att.conf
69+
fi
7470
params+=("-DEXTRA_CONF_FILE=overlay-debug-att.conf")
7571
fi
7672
if [[ "${{ inputs.mqtt }}" == "true" ]]; then

.github/workflows/attach_release_assets.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
pull-requests: write
1818
secrets: inherit
1919
with:
20-
memfault_fw_type: "att"
2120
build_type: release
2221

2322
attach-assets:

.github/workflows/build.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: Build
33
on:
44
workflow_dispatch:
55
inputs:
6-
memfault_fw_type:
7-
description: Memfault Firmware Type
8-
type: string
9-
required: false
10-
default: "att-dev"
116
build_type:
127
description: "Build scope: minimal (thingy91x only), release (all boards, no test builds), all (everything)"
138
type: choice
@@ -24,10 +19,6 @@ on:
2419
default: false
2520
workflow_call:
2621
inputs:
27-
memfault_fw_type:
28-
type: string
29-
required: false
30-
default: "att-dev"
3122
nrfsdk_sha_update:
3223
type: boolean
3324
required: false
@@ -144,15 +135,6 @@ jobs:
144135
- name: Set build type
145136
run: echo "build_type=${{ inputs.build_type || 'minimal' }}" >> $GITHUB_ENV
146137

147-
- name: Set MEMFAULT_FW_TYPE and MEMFAULT_FW_VERSION_PREFIX
148-
shell: bash
149-
run: |
150-
if [[ -z "${{ inputs.memfault_fw_type }}" ]]; then
151-
echo "MEMFAULT_FW_TYPE=att-dev" >> $GITHUB_ENV
152-
else
153-
echo "MEMFAULT_FW_TYPE=${{ inputs.memfault_fw_type }}" >> $GITHUB_ENV
154-
fi
155-
156138
# Asset Tracker Template firmware build
157139
- name: Build thingy91x firmware
158140
if: ${{ env.build_type == 'minimal' || env.build_type == 'release' || env.build_type == 'all' }}
@@ -199,8 +181,7 @@ jobs:
199181
uses: ./asset-tracker-template/.github/actions/build-step
200182
with:
201183
memfault_project_key: ${{ secrets.MEMFAULT_PROJECT_KEY }}
202-
memfault_fw_type: ${{ env.MEMFAULT_FW_TYPE }}
203-
memfault_fw_version_prefix: ${{ env.MEMFAULT_FW_VERSION_PREFIX }}
184+
memfault_release: ${{ env.build_type == 'release' }}
204185
board: thingy91x/nrf9151/ns
205186
short_board: thingy91x
206187
version: ${{ env.VERSION }}-debug

app/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project("Asset Tracker Template")
1111

1212
# Include files that are common for all modules
1313
zephyr_include_directories(src/common)
14-
zephyr_include_directories(config)
14+
zephyr_include_directories(memfault/config)
1515

1616
# Add main application source
1717
target_sources(app PRIVATE src/main.c)

app/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ rsource "src/modules/button/Kconfig.button"
1818
rsource "src/modules/storage/Kconfig.storage"
1919
rsource "src/modules/sgp4/Kconfig.sgp4"
2020
rsource "src/inspect/Kconfig.inspect"
21+
rsource "memfault/Kconfig.memfault"
2122
endmenu
2223

2324
menu "Zephyr Kernel"

app/memfault/Kconfig.memfault

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
if MEMFAULT
8+
9+
# Set Memfault software_version prefix from the VERSION file in the application
10+
config MEMFAULT_NCS_FW_VERSION_PREFIX
11+
default "$(APPVERSION)+" if "$(APPVERSION)" != ""
12+
13+
endif # MEMFAULT
File renamed without changes.
File renamed without changes.

app/overlay-memfault.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CONFIG_MEMFAULT_NCS_STACK_METRICS=y
3030
CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP=y
3131
CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED=y
3232
CONFIG_MEMFAULT_NCS_POST_COREDUMP_RETRIES_MAX=10
33+
CONFIG_MEMFAULT_NCS_FW_TYPE="att"
3334

3435
# Memfault depends on POSIX, disable unneeded POSIX features
3536
CONFIG_POSIX_FILE_SYSTEM=n

app/src/modules/cloud/Kconfig.cloud

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,6 @@ config APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS
140140
Maximum time allowed for processing a single message in the module's state machine.
141141
The value must be smaller than CONFIG_APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS.
142142

143-
if MEMFAULT
144-
145-
# Set Memfault software_version prefix from the VERSION file in the application
146-
config MEMFAULT_NCS_FW_VERSION_PREFIX
147-
default "$(APPVERSION)+" if "$(APPVERSION)" != ""
148-
149-
endif # MEMFAULT
150-
151143
module = APP_CLOUD
152144
module-str = Cloud
153145
source "subsys/logging/Kconfig.template.log_config"

0 commit comments

Comments
 (0)