Merge pull request #1856 from cesanta/zephyr-tests

Zephyr tests
This commit is contained in:
Sergey Lyubka 2022-11-18 10:39:13 +00:00 committed by GitHub
commit 47853547ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 13 deletions

View File

@ -121,19 +121,18 @@ jobs:
- uses: actions/checkout@v3
- name: ${{ matrix.example.path }}
run: make -C examples/${{ matrix.example.path }} build
matrix_zephyr_examples:
zephyr_examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
zephyrexample:
- path: zephyr/device-dashboard
- path: zephyr/http-client
- path: zephyr/http-server
- path: zephyr/mqtt-aws-client
- path: zephyr/websocket-server
name: ${{ matrix.zephyrexample.name }}
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.zephyrexample.path }}
run: make -C examples/${{ matrix.zephyrexample.path }} zephyr build
- run: make -C examples/zephyr init
- name: minify manifest
uses: mikefarah/yq@master
with:
cmd: yq -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $i ireduce({};setpath($i | path; $i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' examples/zephyr/zephyrproject/zephyr/west.yml
- run: make -C examples/zephyr update
- run: make -C examples/zephyr/device-dashboard build
- run: make -C examples/zephyr/http-client build
- run: make -C examples/zephyr/http-server build
- run: make -C examples/zephyr/mqtt-aws-client build
- run: make -C examples/zephyr/websocket-server build

29
examples/zephyr/Makefile Normal file
View File

@ -0,0 +1,29 @@
DOCKER_PROJECT_DIR ?= /workdir
ZEPHYR_DIR ?= zephyrproject
PROJECT_PATH = $(realpath $(CURDIR))
ZEPHYR_PATH = $(realpath $(CURDIR))/$(ZEPHYR_DIR)
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
REPO ?= zephyrprojectrtos/ci
YQ ?= yq
example:
true
init:
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
mkdir $(ZEPHYR_PATH)
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
endif
update:
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
minify:
$(YQ) -i eval '(.manifest.defaults, .manifest.remotes, .manifest.projects[] | select(.name == "cmsis" or .name == "hal_stm32" or .name == "mbedtls" or .name == "mcuboot" or .name == "picolibc" | del(.null) ), .manifest.self) as $$i ireduce({};setpath($$i | path; $$i)) | del(.manifest.projects.[].null) | del(..|select(length==0))' zephyrproject/zephyr/west.yml
zephyr: init minify update