treewide: Rename to Asset Tracker Template #12
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_dispatch: | |
inputs: | |
build_debug: | |
type: boolean | |
required: false | |
default: false | |
workflow_call: | |
inputs: | |
build_bl_update: | |
type: boolean | |
required: false | |
default: false | |
memfault_sw_type: | |
type: string | |
required: false | |
default: "asset-tracker-template-ci" | |
build_debug: | |
type: boolean | |
required: false | |
default: false | |
outputs: | |
run_id: | |
description: The run ID of the workflow to fetch artifacts from | |
value: ${{ jobs.build.outputs.run_id }} | |
version: | |
description: The version of the firmware built on this run_id | |
value: ${{ jobs.build.outputs.version }} | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "tests/on_target/**" | |
pull_request: | |
paths-ignore: | |
- "tests/on_target/**" | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
container: ghcr.io/zephyrproject-rtos/ci:v0.27.4 | |
env: | |
CMAKE_PREFIX_PATH: /opt/toolchains | |
outputs: | |
run_id: ${{ github.run_id }} | |
version: ${{ env.VERSION }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: asset-tracker-template | |
- name: Initialize | |
working-directory: asset-tracker-template | |
run: | | |
west init -l . | |
west config manifest.group-filter +bsec | |
west config build.sysbuild True | |
west update -o=--depth=1 -n | |
west blobs fetch hal_nordic | |
- 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: asset-tracker-template | |
run: | | |
python3 scripts/app_version.py ${GITHUB_REF_NAME} > app/VERSION | |
cat app/VERSION | |
- name: Set MEMFAULT_SW_TYPE from inputs or use default | |
run: | | |
if [ -z "${{ inputs.memfault_sw_type }}" ]; then | |
echo "MEMFAULT_SW_TYPE=asset-tracker-template-ci" >> $GITHUB_ENV | |
else | |
echo "MEMFAULT_SW_TYPE=${{ inputs.memfault_sw_type }}" >> $GITHUB_ENV | |
fi | |
# Out-of-box firmware build | |
- name: Build nrf91 firmware | |
working-directory: asset-tracker-template/app | |
run: | | |
cp overlay-memfault.conf overlay-memfault-att.conf | |
echo "CONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${{ secrets.MEMFAULT_PROJECT_KEY }}\"" >> overlay-memfault-att.conf | |
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-memfault-att.conf | |
echo CONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.VERSION }}\" >> overlay-memfault-att.conf | |
echo CONFIG_MEMFAULT_NCS_FW_TYPE=\"${{ env.MEMFAULT_SW_TYPE }}\" >> overlay-memfault-att.conf | |
west build -b thingy91x/nrf9151/ns -p --sysbuild -- -DEXTRA_CONF_FILE="overlay-memfault-att.conf" | |
- name: Rename artifacts | |
working-directory: asset-tracker-template/app/build | |
run: | | |
cp merged.hex asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.hex | |
cp app/zephyr/.config asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.config | |
cp app/zephyr/zephyr.signed.bin asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-update-signed.bin | |
cp app/zephyr/zephyr.signed.hex asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-update-signed.hex | |
cp app/zephyr/zephyr.elf asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.elf | |
cp dfu_application.zip asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-dfu.zip | |
- name: Create partition manager report for nRF91 firmware | |
working-directory: asset-tracker-template/app/build | |
run: | | |
ninja partition_manager_report | |
ninja partition_manager_report > pmr-nrf91-default-${{ env.VERSION }}.txt | |
sed -i '1d' pmr-nrf91-default-${{ env.VERSION }}.txt | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
id: artifact-upload-att | |
with: | |
name: firmware-att | |
if-no-files-found: error | |
path: | | |
asset-tracker-template/app/build/asset-tracker-template-*.* | |
# Asset Tracker Template debug firmware build | |
- name: Build nrf91 debug firmware | |
if: ${{ inputs.build_debug }} | |
working-directory: asset-tracker-template/app | |
run: | | |
cp overlay-memfault.conf overlay-memfault-debug.conf | |
echo "CONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${{ secrets.MEMFAULT_PROJECT_KEY }}\"" >> overlay-memfault-debug.conf | |
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-memfault-debug.conf | |
echo CONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.VERSION }}-debug\" >> overlay-memfault-debug.conf | |
echo CONFIG_MEMFAULT_NCS_FW_TYPE=\"${{ env.MEMFAULT_SW_TYPE }}\" >> overlay-memfault-debug.conf | |
echo CONFIG_APP_MEMFAULT_UPLOAD_METRICS_ON_CLOUD_READY=y >> overlay-memfault-debug.conf | |
west build -p -b thingy91x/nrf9151/ns -p --sysbuild -- -DEXTRA_CONF_FILE="overlay-memfault-debug.conf;overlay-modemtrace-to-memfault.conf;overlay-etb.conf" | |
- name: Rename debug artifacts | |
if: ${{ inputs.build_debug }} | |
working-directory: asset-tracker-template/app/build | |
run: | | |
cp merged.hex asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.hex | |
cp app/zephyr/.config asset-tracker-template-${{ env.VERSION }}-debug-thingy91x-nrf91.config | |
cp app/zephyr/zephyr.signed.bin asset-tracker-template-${{ env.VERSION }}-debug-thingy91x-nrf91-update-signed.bin | |
cp app/zephyr/zephyr.signed.hex asset-tracker-template-${{ env.VERSION }}-debug-thingy91x-nrf91-update-signed.hex | |
cp app/zephyr/zephyr.elf asset-tracker-template-${{ env.VERSION }}-debug-thingy91x-nrf91.elf | |
cp dfu_application.zip asset-tracker-template-${{ env.VERSION }}-debug-thingy91x-nrf91-dfu.zip | |
- name: Create partition manager report for nRF91 debug firmware | |
if: ${{ inputs.build_debug }} | |
working-directory: asset-tracker-template/app/build | |
run: | | |
ninja partition_manager_report | |
ninja partition_manager_report > pmr-nrf91-debug-${{ env.VERSION }}.txt | |
sed -i '1d' pmr-nrf91-debug-${{ env.VERSION }}.txt | |
- name: Upload artifact | |
if: ${{ inputs.build_debug }} | |
uses: actions/upload-artifact@v4 | |
id: artifact-upload-att-debug | |
with: | |
name: firmware-att-debug | |
if-no-files-found: error | |
path: | | |
asset-tracker-template/app/build/asset-tracker-template-*.* | |
asset-tracker-template/app/build/pmr-nrf91-*.txt | |
- name: Print run-id and fw version | |
run: | | |
echo Run id: ${{ github.run_id }} | |
echo Version: ${{ env.VERSION }} |