From 77c204397e3f6d32e296bde2240b15ccb7b94f21 Mon Sep 17 00:00:00 2001 From: rbaron Date: Sat, 21 Oct 2023 10:28:18 +0200 Subject: [PATCH 1/4] Bump nrf-connect sdk version to 2.4.2 Manually tested with both ble and zigbee samples. --- .github/actions/build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build/Dockerfile b/.github/actions/build/Dockerfile index 0f54cda..865cbbf 100644 --- a/.github/actions/build/Dockerfile +++ b/.github/actions/build/Dockerfile @@ -1,4 +1,4 @@ -FROM nordicplayground/nrfconnect-sdk:v2.2-branch +FROM nordicplayground/nrfconnect-sdk:v2.4-branch COPY build.sh /build.sh From 35618227d5a6f43beeb8b4563cd83cac839c5325 Mon Sep 17 00:00:00 2001 From: rbaron Date: Sat, 21 Oct 2023 10:30:36 +0200 Subject: [PATCH 2/4] Also bump in devcontainer.json --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9aed6d4..f8b020e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { - "name": "nrf-connect:v2.2", - "image": "nordicplayground/nrfconnect-sdk:v2.2-branch", + "name": "nrf-connect:v2.4", + "image": "nordicplayground/nrfconnect-sdk:v2.4-branch", "features": { }, "customizations": { From 141071a4142d8dd9f7ecaa8d77018a7e591a668f Mon Sep 17 00:00:00 2001 From: rbaron Date: Sat, 21 Oct 2023 17:21:39 +0200 Subject: [PATCH 3/4] Refactor github actions Reason: https://github.com/NordicPlayground/nrf-docker/pull/75 --- .github/actions/build/Dockerfile | 5 --- .github/actions/build/action.yml | 41 ++++++++++++--------- .github/actions/build/build.sh | 21 ----------- .github/actions/build_and_upload/action.yml | 20 +++++----- .github/workflows/b-parasite.yml | 12 +++--- 5 files changed, 40 insertions(+), 59 deletions(-) delete mode 100644 .github/actions/build/Dockerfile delete mode 100755 .github/actions/build/build.sh diff --git a/.github/actions/build/Dockerfile b/.github/actions/build/Dockerfile deleted file mode 100644 index 865cbbf..0000000 --- a/.github/actions/build/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM nordicplayground/nrfconnect-sdk:v2.4-branch - -COPY build.sh /build.sh - -ENTRYPOINT ["/build.sh"] \ No newline at end of file diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 1130965..bd5c3de 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -1,27 +1,34 @@ -name: 'Build' -description: 'Builds a nrf-connect sample for b-parasite' +name: "Build" +description: "Builds a nrf-connect sample for b-parasite" inputs: sample-dir: - description: 'Sample directory to build' + description: "Sample directory to build" required: true board: - description: 'Board definition to use' + description: "Board definition to use" default: bparasite_nrf52840 revision: - description: 'Board revision use' - default: '1.2.0' + description: "Board revision use" + default: "2.0.0" cmake-extra: - description: 'Extra CMake arguments' - default: '' + description: "Extra CMake arguments" + default: "" output-bin: - description: 'Name of the .hex output' + description: "Name of the .hex output" required: true runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.sample-dir }} - - ${{ inputs.board }} - - ${{ inputs.revision }} - - ${{ inputs.cmake-extra }} - - ${{ inputs.output-bin }} + using: "composite" + steps: + - run: | + docker run --rm -v ${GITHUB_WORKSPACE}:/repo \ + nordicplayground/nrfconnect-sdk:v2.4-branch \ + west build \ + --build-dir /repo/${{ inputs.sample-dir }}/build \ + --pristine \ + --board ${{ inputs.board }}@${{ inputs.revision }} \ + /repo/${{ inputs.sample-dir }} -- ${{ inputs.cmake-extra }} + shell: bash + - run: | + cp "${GITHUB_WORKSPACE}"/${{ inputs.sample-dir }}/build/zephyr/zephyr.hex \ + "${GITHUB_WORKSPACE}"/${{ inputs.sample-dir }}/build/zephyr/${{ inputs.output-bin }} + shell: bash diff --git a/.github/actions/build/build.sh b/.github/actions/build/build.sh deleted file mode 100755 index b32fc87..0000000 --- a/.github/actions/build/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -eux -o pipefail - -SAMPLE_DIR=$1 -BOARD=$2 -REVISION=$3 -CMAKE_EXTRA=$4 -OUTPUT_BIN=$5 - -TODAY=$(date +'%Y-%m-%d') - -# Replaces occurrences of "__TODAY__" with $TODAY in $CMAKE_EXTRA. -CMAKE_EXTRA="${CMAKE_EXTRA/__TODAY__/"$TODAY"}" - -cd "${GITHUB_WORKSPACE}/${SAMPLE_DIR}" - -echo $CMAKE_EXTRA - -west build --build-dir ./build --pristine --board "${BOARD}@${REVISION}" -- $CMAKE_EXTRA - -mv build/zephyr/zephyr.hex build/zephyr/"${OUTPUT_BIN}" \ No newline at end of file diff --git a/.github/actions/build_and_upload/action.yml b/.github/actions/build_and_upload/action.yml index 7939a8f..be2b199 100644 --- a/.github/actions/build_and_upload/action.yml +++ b/.github/actions/build_and_upload/action.yml @@ -1,20 +1,20 @@ -name: 'Build and upload artifact' -description: 'Builds a nrf-connect sample for b-parasite' +name: "Build and upload artifact" +description: "Builds a nrf-connect sample for b-parasite" inputs: sample-dir: - description: 'Sample directory to build' + description: "Sample directory to build" required: true board: - description: 'Board definition to use' + description: "Board definition to use" required: true revision: - description: 'Board revision use' - default: '1.2.0' + description: "Board revision use" + default: "2.0.0" cmake-extra: - description: 'Extra CMake arguments' - default: '' + description: "Extra CMake arguments" + default: "" output-bin: - description: 'Name of the .hex output' + description: "Name of the .hex output" required: true runs: @@ -30,4 +30,4 @@ runs: - uses: actions/upload-artifact@v3 with: name: sample-binaries - path: ${{ inputs.sample-dir }}/build/zephyr/${{ inputs.output-bin }} \ No newline at end of file + path: ${{ inputs.sample-dir }}/build/zephyr/${{ inputs.output-bin }} diff --git a/.github/workflows/b-parasite.yml b/.github/workflows/b-parasite.yml index 4186cfe..8d20e2d 100644 --- a/.github/workflows/b-parasite.yml +++ b/.github/workflows/b-parasite.yml @@ -17,7 +17,7 @@ jobs: - name: Check clang-format uses: jidicula/clang-format-action@v4.9.0 with: - check-path: 'code/nrf-connect' + check-path: "code/nrf-connect" exclude-regex: '\/build\/' build-blinky: @@ -27,7 +27,7 @@ jobs: - lint steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build blinky uses: ./.github/actions/build with: @@ -43,7 +43,7 @@ jobs: - lint steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build input uses: ./.github/actions/build with: @@ -59,7 +59,7 @@ jobs: - lint steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build soil_read_loop uses: ./.github/actions/build with: @@ -79,7 +79,7 @@ jobs: - lint steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build uses: ./.github/actions/build_and_upload with: @@ -100,7 +100,7 @@ jobs: - lint steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build uses: ./.github/actions/build_and_upload with: From d5ed701c45bd36313967578cf4bb8530c9151bf9 Mon Sep 17 00:00:00 2001 From: rbaron Date: Sat, 21 Oct 2023 17:26:55 +0200 Subject: [PATCH 4/4] Simplify actions -- no artifacts --- .github/actions/build/action.yml | 7 ----- .github/actions/build_and_upload/action.yml | 33 --------------------- .github/workflows/b-parasite.yml | 4 +-- 3 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 .github/actions/build_and_upload/action.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index bd5c3de..56e880c 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -13,9 +13,6 @@ inputs: cmake-extra: description: "Extra CMake arguments" default: "" - output-bin: - description: "Name of the .hex output" - required: true runs: using: "composite" steps: @@ -28,7 +25,3 @@ runs: --board ${{ inputs.board }}@${{ inputs.revision }} \ /repo/${{ inputs.sample-dir }} -- ${{ inputs.cmake-extra }} shell: bash - - run: | - cp "${GITHUB_WORKSPACE}"/${{ inputs.sample-dir }}/build/zephyr/zephyr.hex \ - "${GITHUB_WORKSPACE}"/${{ inputs.sample-dir }}/build/zephyr/${{ inputs.output-bin }} - shell: bash diff --git a/.github/actions/build_and_upload/action.yml b/.github/actions/build_and_upload/action.yml deleted file mode 100644 index be2b199..0000000 --- a/.github/actions/build_and_upload/action.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: "Build and upload artifact" -description: "Builds a nrf-connect sample for b-parasite" -inputs: - sample-dir: - description: "Sample directory to build" - required: true - board: - description: "Board definition to use" - required: true - revision: - description: "Board revision use" - default: "2.0.0" - cmake-extra: - description: "Extra CMake arguments" - default: "" - output-bin: - description: "Name of the .hex output" - required: true - -runs: - using: "composite" - steps: - - uses: ./.github/actions/build - with: - sample-dir: ${{ inputs.sample-dir }} - board: ${{ inputs.board }} - revision: ${{ inputs.revision }} - cmake-extra: ${{ inputs.cmake-extra }} - output-bin: ${{ inputs.output-bin }} - - uses: actions/upload-artifact@v3 - with: - name: sample-binaries - path: ${{ inputs.sample-dir }}/build/zephyr/${{ inputs.output-bin }} diff --git a/.github/workflows/b-parasite.yml b/.github/workflows/b-parasite.yml index 8d20e2d..97fe1cd 100644 --- a/.github/workflows/b-parasite.yml +++ b/.github/workflows/b-parasite.yml @@ -81,7 +81,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Build - uses: ./.github/actions/build_and_upload + uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/ble board: bparasite_${{ matrix.soc }} @@ -102,7 +102,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Build - uses: ./.github/actions/build_and_upload + uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/zigbee board: bparasite_${{ matrix.soc }}