From ac55c900e767957d3a73ad46b22044024776f2ef Mon Sep 17 00:00:00 2001 From: Alex Alashkin Date: Mon, 16 May 2022 13:10:01 +0300 Subject: [PATCH] Use docker for Zephyr CI --- .github/workflows/test.yml | 10 +++++++-- examples/zephyr/.zephyr_install.sh | 26 ----------------------- examples/zephyr/Makefile | 12 ----------- examples/zephyr/http-client/Makefile | 7 +++--- examples/zephyr/http-server/Makefile | 7 +++--- examples/zephyr/mqtt-aws-client/Makefile | 7 +++--- examples/zephyr/websocket-server/Makefile | 7 +++--- 7 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 examples/zephyr/.zephyr_install.sh delete mode 100644 examples/zephyr/Makefile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7b8e47c..b772e949 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -118,10 +118,16 @@ jobs: path: nxp/nxp-twrkv58f220m-lwip-freertos - name: infineon-xmc4700_4800-lwip-rtx-rtos path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos - - name: zephyr - path: zephyr - name: ti path: ti/ti-ek-tm4c1294xl-http-server + - name: nucleo_f746zg-zephyr-http-client + path: zephyr/http-client + - name: nucleo_f746zg-zephyr-http-server + path: zephyr/http-server + - name: nucleo_f746zg-zephyr-mqtt-aws-client + path: zephyr/mqtt-aws-client + - name: nucleo_f746zg-zephyr-websocket-server + path: zephyr/websocket-server name: ${{ matrix.example.name }} steps: - uses: actions/checkout@v3 diff --git a/examples/zephyr/.zephyr_install.sh b/examples/zephyr/.zephyr_install.sh deleted file mode 100644 index 36d90e13..00000000 --- a/examples/zephyr/.zephyr_install.sh +++ /dev/null @@ -1,26 +0,0 @@ -# See https://docs.zephyrproject.org/latest/develop/getting_started/index.html -# for script details - -ZEPHYR_SDK_VER=0.14.0 - -cd ~ -sudo apt install -y wget -rm -rf kitware-archive.sh -wget https://apt.kitware.com/kitware-archive.sh -sudo bash kitware-archive.sh -sudo apt install --no-install-recommends -y git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev -pip3 install --user -U west -export PATH=~/.local/bin:"$PATH" -rm -rf ~/zephyrproject -west init ~/zephyrproject -cd ~/zephyrproject -west update -west zephyr-export -pip3 install --user -r ~/zephyrproject/zephyr/scripts/requirements.txt -cd ~ -rm -rf zephyr-sdk-${ZEPHYR_SDK_VER}_linux-x86_64.tar.gz -echo Downloading zephyr-sdk-${ZEPHYR_SDK_VER} -wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VER}/zephyr-sdk-${ZEPHYR_SDK_VER}_linux-x86_64.tar.gz -tar xf zephyr-sdk-${ZEPHYR_SDK_VER}_linux-x86_64.tar.gz -cd zephyr-sdk-${ZEPHYR_SDK_VER} -./setup.sh -c diff --git a/examples/zephyr/Makefile b/examples/zephyr/Makefile deleted file mode 100644 index 7942a544..00000000 --- a/examples/zephyr/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -example: - true - -build: - sh .zephyr_install.sh - make -C http-client build - make -C http-server build - make -C mqtt-aws-client build - make -C websocket-server build - -clean: - rm -rf */*/mongoose.* diff --git a/examples/zephyr/http-client/Makefile b/examples/zephyr/http-client/Makefile index 9b960341..5a096a5a 100644 --- a/examples/zephyr/http-client/Makefile +++ b/examples/zephyr/http-client/Makefile @@ -1,13 +1,14 @@ -CWD = $(realpath $(CURDIR)) -ZEPHYR_DIR ?= $(realpath ../../../../../../zephyrproject) +PROJECT_DIR ?= /mnt +ZEPHYR_DIR ?= /zephyrproject BOARD ?= nucleo_f746zg +DOCKER ?= docker run -v $(realpath $(CURDIR)):/mnt mdashnet/zephyr example: true build: cp ../../../mongoose.c ../../../mongoose.h src/ - cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(CWD) + $(DOCKER) /bin/sh -c 'cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(PROJECT_DIR)' flash: cd $(ZEPHYR_DIR) && west flash diff --git a/examples/zephyr/http-server/Makefile b/examples/zephyr/http-server/Makefile index 9b960341..5a096a5a 100644 --- a/examples/zephyr/http-server/Makefile +++ b/examples/zephyr/http-server/Makefile @@ -1,13 +1,14 @@ -CWD = $(realpath $(CURDIR)) -ZEPHYR_DIR ?= $(realpath ../../../../../../zephyrproject) +PROJECT_DIR ?= /mnt +ZEPHYR_DIR ?= /zephyrproject BOARD ?= nucleo_f746zg +DOCKER ?= docker run -v $(realpath $(CURDIR)):/mnt mdashnet/zephyr example: true build: cp ../../../mongoose.c ../../../mongoose.h src/ - cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(CWD) + $(DOCKER) /bin/sh -c 'cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(PROJECT_DIR)' flash: cd $(ZEPHYR_DIR) && west flash diff --git a/examples/zephyr/mqtt-aws-client/Makefile b/examples/zephyr/mqtt-aws-client/Makefile index 9b960341..5a096a5a 100644 --- a/examples/zephyr/mqtt-aws-client/Makefile +++ b/examples/zephyr/mqtt-aws-client/Makefile @@ -1,13 +1,14 @@ -CWD = $(realpath $(CURDIR)) -ZEPHYR_DIR ?= $(realpath ../../../../../../zephyrproject) +PROJECT_DIR ?= /mnt +ZEPHYR_DIR ?= /zephyrproject BOARD ?= nucleo_f746zg +DOCKER ?= docker run -v $(realpath $(CURDIR)):/mnt mdashnet/zephyr example: true build: cp ../../../mongoose.c ../../../mongoose.h src/ - cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(CWD) + $(DOCKER) /bin/sh -c 'cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(PROJECT_DIR)' flash: cd $(ZEPHYR_DIR) && west flash diff --git a/examples/zephyr/websocket-server/Makefile b/examples/zephyr/websocket-server/Makefile index 9b960341..5a096a5a 100644 --- a/examples/zephyr/websocket-server/Makefile +++ b/examples/zephyr/websocket-server/Makefile @@ -1,13 +1,14 @@ -CWD = $(realpath $(CURDIR)) -ZEPHYR_DIR ?= $(realpath ../../../../../../zephyrproject) +PROJECT_DIR ?= /mnt +ZEPHYR_DIR ?= /zephyrproject BOARD ?= nucleo_f746zg +DOCKER ?= docker run -v $(realpath $(CURDIR)):/mnt mdashnet/zephyr example: true build: cp ../../../mongoose.c ../../../mongoose.h src/ - cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(CWD) + $(DOCKER) /bin/sh -c 'cd $(ZEPHYR_DIR) && west build -b $(BOARD) -p auto $(PROJECT_DIR)' flash: cd $(ZEPHYR_DIR) && west flash