From 6dafcf26d80d0d0d1901b8b3b5645f02436c6d00 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Thu, 28 Jan 2021 15:47:30 +0100 Subject: [PATCH] [.github/workflows] Added pigweed-app related builds to workflows. There is no build validation in CI for pigweed-app, as this app related builds are not ran in the github workflows. * Modified nrfconnect_example.sh to take board name as an mandatory argument and also allow passing list of additional arguments (e.g. attaching overlays). * Added pigweed-app build and lighting-app with rpc.overlay build to the nrfconnect github workflows. * Renamed esp_echo_app.sh to the esp_example.sh and modified it to take application name as an argument. * Added pigweed-app build to the esp32 github workflow. * Renamed Echo App build step to the All Clusters App in the esp32 and qemu github workflows, as in fact that app is being build. --- .github/workflows/examples-esp32.yaml | 11 +++++++++-- .github/workflows/examples-nrfconnect.yaml | 14 ++++++++------ .github/workflows/qemu.yaml | 4 ++-- .github/workflows/release_artifacts.yaml | 2 +- .vscode/tasks.json | 16 ++++++++-------- .../examples/{esp_echo_app.sh => esp_example.sh} | 10 +++++++++- scripts/examples/nrfconnect_example.sh | 12 ++++++++++-- 7 files changed, 47 insertions(+), 22 deletions(-) rename scripts/examples/{esp_echo_app.sh => esp_example.sh} (91%) diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index e12ed6f6d79851..d60f5944a75d2f 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -46,13 +46,20 @@ jobs: with: languages: "cpp, python" queries: +security-and-quality - - name: Build example Echo App - run: scripts/examples/esp_echo_app.sh + - name: Build example All Clusters App + run: scripts/examples/esp_example.sh all-clusters-app - name: Copy aside build products run: | mkdir -p example_binaries/$BUILD_TYPE-build cp examples/all-clusters-app/esp32/build/chip-all-clusters-app.elf \ example_binaries/$BUILD_TYPE-build/chip-all-clusters-app.elf + - name: Build example Pigweed App + run: scripts/examples/esp_example.sh pigweed-app + - name: Copy aside build products + run: | + mkdir -p example_binaries/$BUILD_TYPE-build + cp examples/pigweed-app/esp32/build/chip-pigweed-app.elf \ + example_binaries/$BUILD_TYPE-build/chip-pigweed-app.elf - name: Binary artifact suffix id: outsuffix uses: haya14busa/action-cond@v1.0.0 diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 263b9d2a855bab..6d86f9bb0c4ca2 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -45,12 +45,14 @@ jobs: # with: # languages: "cpp, python" # queries: +security-and-quality - - name: Build example nRF Connect SDK Lock App - run: scripts/examples/nrfconnect_example.sh lock-app - - name: Build example nRF Connect SDK Lighting App - run: scripts/examples/nrfconnect_example.sh lighting-app - - name: Build example nRF Connect SDK Shell - run: scripts/examples/nrfconnect_example.sh shell + - name: Build example nRF Connect SDK Lock App on nRF52840 DK + run: scripts/examples/nrfconnect_example.sh lock-app nrf52840dk_nrf52840 + - name: Build example nRF Connect SDK Lighting App on nRF52840 DK + run: scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840 -DOVERLAY_CONFIG=rpc.overlay + - name: Build example nRF Connect SDK Shell on nRF52840 DK + run: scripts/examples/nrfconnect_example.sh shell nrf52840dk_nrf52840 + - name: Build example nRF Connect SDK Pigweed on nRF52840 DK + run: scripts/examples/nrfconnect_example.sh pigweed-app nrf52840dk_nrf52840 - name: Run unit tests for Zephyr native_posix_64 platform run: scripts/tests/nrfconnect_native_posix_tests.sh native_posix_64 diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 7af7ba7ac944cf..8b9308e6ab9d4c 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -37,8 +37,8 @@ jobs: uses: actions/checkout@v2 with: submodules: true - - name: Build example Echo App - run: scripts/examples/esp_echo_app.sh + - name: Build example All Clusters App + run: scripts/examples/esp_example.sh all-clusters-app - name: Build ESP32 QEMU and Run Tests run: scripts/tests/esp32_qemu_tests.sh /tmp/test_logs - name: Uploading Logs diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 06bd57321140d8..3b7a0b2b444833 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -37,7 +37,7 @@ jobs: with: submodules: true - name: Build - run: scripts/examples/esp_echo_app.sh + run: scripts/examples/esp_example.sh all-clusters-app - name: Upload artifact run: | diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e8d081329152df..d4fa225b46561f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -181,9 +181,9 @@ "problemMatcher": ["$gcc"] }, { - "label": "Build nRF Connect Lock Example", + "label": "Build nRF Connect Lock Example (nRF52840)", "type": "shell", - "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh lock-app", + "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh lock-app nrf52840dk_nrf52840", "group": "build", "problemMatcher": { "base": "$gcc", @@ -194,9 +194,9 @@ } }, { - "label": "Build nRF Connect Lighting Example", + "label": "Build nRF Connect Lighting Example (nRF52840)", "type": "shell", - "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh lighting-app", + "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840 -DOVERLAY_CONFIG=rpc.overlay", "group": "build", "problemMatcher": { "base": "$gcc", @@ -207,9 +207,9 @@ } }, { - "label": "Build nRF Connect Shell Example", + "label": "Build nRF Connect Shell Example (nRF52840)", "type": "shell", - "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh shell", + "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh shell nrf52840dk_nrf52840", "group": "build", "problemMatcher": { "base": "$gcc", @@ -220,9 +220,9 @@ } }, { - "label": "Build nRF Connect Pigweed Example", + "label": "Build nRF Connect Pigweed Example (nRF52840)", "type": "shell", - "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh pigweed-app", + "command": "source scripts/activate.sh && scripts/examples/nrfconnect_example.sh pigweed-app nrf52840dk_nrf52840", "group": "build", "problemMatcher": { "base": "$gcc", diff --git a/scripts/examples/esp_echo_app.sh b/scripts/examples/esp_example.sh similarity index 91% rename from scripts/examples/esp_echo_app.sh rename to scripts/examples/esp_example.sh index 1b18eaf54a7fd0..f1b548976443d9 100755 --- a/scripts/examples/esp_echo_app.sh +++ b/scripts/examples/esp_example.sh @@ -19,7 +19,15 @@ set -x env -root=examples/all-clusters-app/esp32/ +app="$1" +root=examples/$app/esp32/ + +shift 1 + +if [ -z "$app" ]; then + echo "No mandatory app argument supplied!" + exit 1 +fi # shellcheck source=/dev/null source "$root"/idf.sh diff --git a/scripts/examples/nrfconnect_example.sh b/scripts/examples/nrfconnect_example.sh index dde63ac5288ae6..a2a3ce16915c22 100755 --- a/scripts/examples/nrfconnect_example.sh +++ b/scripts/examples/nrfconnect_example.sh @@ -16,12 +16,15 @@ # limitations under the License. # -# Run bootstrap to set up e.g. Pigweed correctly +# Run bootstrap and activate to set up e.g. Pigweed correctly source "$(dirname "$0")/../../scripts/bootstrap.sh" +source "$(dirname "$0")/../../scripts/activate.sh" cd "$(dirname "$0")/../../examples" APP="$1" +BOARD="$2" +shift 2 if [[ ! -f "$APP/nrfconnect/CMakeLists.txt" ]]; then echo "Usage: $0 " >&2 @@ -30,8 +33,13 @@ if [[ ! -f "$APP/nrfconnect/CMakeLists.txt" ]]; then exit 1 fi +if [ -z "$BOARD" ]; then + echo "No mandatory BOARD argument supplied!" + exit 1 +fi + set -x [[ -n $ZEPHYR_BASE ]] && source "$ZEPHYR_BASE/zephyr-env.sh" env -west build -b nrf52840dk_nrf52840 -d "$APP/nrfconnect/build" "$APP/nrfconnect" +west build -b $BOARD -d "$APP/nrfconnect/build" "$APP/nrfconnect" -- "$@"