generated from golioth/reference-design-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from golioth/merge/template_v2.4.1
Merge template v2.4.1
- Loading branch information
Showing
33 changed files
with
1,231 additions
and
449 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Copyright (c) 2023 Golioth, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build Zephyr binaries | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ZEPHYR_SDK: | ||
required: true | ||
type: string | ||
default: 0.16.3 | ||
BOARD: | ||
required: true | ||
type: string | ||
default: aludel_mini_v1_sparkfun9160_ns | ||
ARTIFACT: | ||
required: true | ||
type: boolean | ||
default: false | ||
TAG: | ||
type: string | ||
|
||
workflow_call: | ||
inputs: | ||
ZEPHYR_SDK: | ||
required: true | ||
type: string | ||
BOARD: | ||
required: true | ||
type: string | ||
ARTIFACT: | ||
required: true | ||
type: boolean | ||
TAG: | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
container: golioth/golioth-zephyr-base:${{ inputs.ZEPHYR_SDK }}-SDK-v0 | ||
|
||
env: | ||
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-${{ inputs.ZEPHYR_SDK }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: app | ||
- name: Setup West workspace | ||
run: | | ||
west init -l app | ||
west update --narrow -o=--depth=1 | ||
west zephyr-export | ||
pip3 install -r deps/zephyr/scripts/requirements-base.txt | ||
# Needed for TF-M | ||
pip3 install cryptography pyasn1 pyyaml cbor>=1.0.0 imgtool>=1.9.0 jinja2 click | ||
- name: Build with West | ||
run: | | ||
west build -p -b ${{ inputs.BOARD }} --sysbuild app | ||
- name: Prepare artifacts | ||
shell: bash | ||
if: inputs.ARTIFACT == true && inputs.TAG != '' | ||
|
||
run: | | ||
cd build | ||
mkdir -p artifacts | ||
BOARD_NICENAME=${{ inputs.BOARD }} | ||
BOARD_NICENAME=${BOARD_NICENAME//\//_} | ||
mv merged.hex ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}_full.hex | ||
mv app/zephyr/zephyr.signed.bin ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}_update.bin | ||
mv app/zephyr/zephyr.elf ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}.elf | ||
# Run IDs are unique per repo but are reused on re-runs | ||
- name: Save artifact | ||
if: inputs.ARTIFACT == true | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build_artifacts_${{ github.run_id }} | ||
path: | | ||
build/artifacts/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright (c) 2023 Golioth, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Create Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release Version.' | ||
required: true | ||
default: 'template_v0.0.0' | ||
type: string | ||
|
||
jobs: | ||
build-binaries: | ||
strategy: | ||
matrix: | ||
ZEPHYR_SDK: [0.16.3] | ||
BOARD: ["nrf9160dk/nrf9160/ns","aludel_mini/nrf9160/ns","aludel_elixir/nrf9160/ns"] | ||
|
||
uses: ./.github/workflows/build_zephyr.yml | ||
with: | ||
ZEPHYR_SDK: ${{ matrix.ZEPHYR_SDK }} | ||
BOARD: ${{ matrix.BOARD }} | ||
ARTIFACT: true | ||
TAG: ${{ inputs.version }} | ||
|
||
upload-binaries: | ||
needs: build-binaries | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build_artifacts_${{ github.run_id }} | ||
path: ~/artifacts | ||
|
||
- name: Create Release manually with GH CLI | ||
run: gh release create --title ${{ inputs.version }} --draft ${{ inputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload artifacts to release | ||
run: gh release upload --clobber ${{ inputs.version }} ~/artifacts/*.* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) 2023 Golioth, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Test firmware | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test_build_nrf9160dk: | ||
uses: ./.github/workflows/build_zephyr.yml | ||
with: | ||
ZEPHYR_SDK: 0.16.3 | ||
BOARD: nrf9160dk/nrf9160/ns | ||
ARTIFACT: false | ||
test_build_aludel_elixir: | ||
uses: ./.github/workflows/build_zephyr.yml | ||
with: | ||
ZEPHYR_SDK: 0.16.3 | ||
BOARD: aludel_elixir/nrf9160/ns | ||
ARTIFACT: false | ||
test_build_aludel_mini: | ||
uses: ./.github/workflows/build_zephyr.yml | ||
with: | ||
ZEPHYR_SDK: 0.16.3 | ||
BOARD: aludel_mini/nrf9160/ns | ||
ARTIFACT: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Copyright (c) 2023 Golioth, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
build*/ | ||
.vscode | ||
.cache | ||
credentials.conf | ||
__pycache__/ | ||
golioth-boards |
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
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
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
Oops, something went wrong.