tests: on_target: add mfw delta fota test #1114
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_call: | |
inputs: | |
build_bl_update: | |
type: boolean | |
required: false | |
default: false | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
container: ghcr.io/zephyrproject-rtos/ci:v0.26.13 | |
env: | |
CMAKE_PREFIX_PATH: /opt/toolchains | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: thingy91x-oob | |
- name: Initialize | |
working-directory: thingy91x-oob | |
run: | | |
west init -l . | |
west config manifest.group-filter +bsec | |
west config build.sysbuild True | |
west update -o=--depth=1 -n | |
- name: Install dependencies | |
run: | | |
pip install -r nrf/scripts/requirements-build.txt | |
- name: Set VERSION environment variable | |
shell: bash | |
run: | | |
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then | |
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
else | |
echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV | |
fi | |
- name: Update VERSION file for release | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
working-directory: thingy91x-oob | |
run: | | |
python3 scripts/app_version.py ${GITHUB_REF_NAME} > app/VERSION | |
cat app/VERSION | |
- name: Build nrf91 firmware | |
working-directory: thingy91x-oob/app | |
run: | | |
echo "CONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${{ secrets.MEMFAULT_PROJECT_KEY }}\"" >> overlay-memfault.conf | |
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-memfault.conf | |
echo CONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.VERSION }}\" >> overlay-memfault.conf | |
west build -b thingy91x/nrf9151/ns -p --sysbuild -- -DEXTRA_CONF_FILE="overlay-memfault.conf" | |
- name: Create nrf91 Bootloader HEX file | |
run: | | |
python3 zephyr/scripts/build/mergehex.py -o $(pwd)/thingy91x-oob/app/build/b0_s0_s1_merged.hex $(pwd)/thingy91x-oob/app/build/b0_container.hex $(pwd)/thingy91x-oob/app/build/app_provision.hex $(pwd)/thingy91x-oob/app/build/signed_by_b0_mcuboot.hex $(pwd)/thingy91x-oob/app/build/signed_by_b0_s1_image.hex | |
- name: Build nrf53 firmware | |
working-directory: nrf/applications/connectivity_bridge | |
run: | | |
west build -b thingy91x/nrf5340/cpuapp -p --sysbuild | |
- name: Create nrf53 merged_domains HEX file | |
run: | | |
python3 zephyr/scripts/build/mergehex.py -o $(pwd)/thingy91x-oob/app/build/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-connectivity-bridge.hex $(pwd)/nrf/applications/connectivity_bridge/build/merged_CPUNET.hex $(pwd)/nrf/applications/connectivity_bridge/build/merged.hex | |
- name: Create nrf53 Bootloader HEX file | |
run: | | |
python3 zephyr/scripts/build/mergehex.py -o $(pwd)/thingy91x-oob/app/build/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-bootloader.hex $(pwd)/nrf/applications/connectivity_bridge/build/b0_container.hex $(pwd)/nrf/applications/connectivity_bridge/build/signed_by_b0_mcuboot.hex $(pwd)/nrf/applications/connectivity_bridge/build/signed_by_b0_s1_image.hex $(pwd)/nrf/applications/connectivity_bridge/build/app_provision.hex $(pwd)/nrf/applications/connectivity_bridge/build/b0n_container.hex $(pwd)/nrf/applications/connectivity_bridge/build/net_provision.hex | |
- name: Copy nrf53 DFU file | |
run: | | |
cp $(pwd)/nrf/applications/connectivity_bridge/build/dfu_application.zip $(pwd)/thingy91x-oob/app/build/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-dfu.zip | |
- name: Apply Connectivity Bridge Patch | |
run: git apply thingy91x-oob/scripts/connectivity_bridge.patch --directory=nrf | |
- name: Build BL Update | |
if: ${{ inputs.build_bl_update }} | |
working-directory: thingy91x-oob | |
run: | | |
west twister -T . --test app/app.build.bootloader_update -v -p thingy91x/nrf9151/ns --inline-logs | |
cp twister-out/thingy91x_nrf9151_ns/app/app.build.bootloader_update/dfu_mcuboot.zip app/build/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf91-bootloader.zip | |
rm -rf twister-out | |
west twister -T ../nrf/applications/connectivity_bridge --test applications.connectivity_bridge.bootloader_update -v -p thingy91x/nrf5340/cpuapp --inline-logs | |
cp twister-out/thingy91x_nrf5340_cpuapp/applications.connectivity_bridge.bootloader_update/dfu_mcuboot.zip app/build/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-bootloader.zip | |
cp twister-out/thingy91x_nrf5340_cpuapp/applications.connectivity_bridge.bootloader_update/dfu_application.zip app/build/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-connectivity-bridge-verbose.zip | |
- name: Rename artifacts | |
working-directory: thingy91x-oob/app/build | |
run: | | |
cp merged.hex hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app.hex | |
cp app/zephyr/.config hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app.config | |
cp app/zephyr/zephyr.signed.bin hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app_update_signed.bin | |
cp app/zephyr/zephyr.signed.hex hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app_update_signed.hex | |
cp app/zephyr/zephyr.elf hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app.elf | |
cp b0_s0_s1_merged.hex hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-bootloader.hex | |
cp dfu_application.zip hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf91-dfu.zip | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: firmware | |
if-no-files-found: error | |
path: | | |
thingy91x-oob/app/build/hello.nrfcloud.com-*.* |