From 014a386dfb5391124231a7221149f62c4923bae6 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 28 Apr 2021 18:20:31 -0700 Subject: [PATCH] .github: add Zephyr build Use the official image from the Zephyr project https://github.com/zephyrproject-rtos/docker-image Signed-off-by: Marc Herbert --- .github/workflows/zephyr.yml | 24 ++++++++++++++++++++++++ zephyr/docker-build.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/zephyr.yml create mode 100755 zephyr/docker-build.sh diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml new file mode 100644 index 000000000..281e1a554 --- /dev/null +++ b/.github/workflows/zephyr.yml @@ -0,0 +1,24 @@ +--- + +name: Zephyr + +# 'workflow_dispatch' allows running this workflow manually from the +# 'Actions' tab +# yamllint disable-line rule:truthy +on: [push, pull_request, workflow_dispatch] + +jobs: + zephyr-build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + # From time to time this will catch a git tag and change SOF_VERSION + with: {fetch-depth: 10, submodules: recursive} + + - name: yamllint ourselves + run: yamllint .github/workflows/zephyr.yml + + - name: build + run: docker run -v "$(pwd)":/workdir + docker.io/zephyrprojectrtos/zephyr-build:latest + ./zephyr/docker-build.sh diff --git a/zephyr/docker-build.sh b/zephyr/docker-build.sh new file mode 100755 index 000000000..80bae2cc5 --- /dev/null +++ b/zephyr/docker-build.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2021 Intel Corporation. All rights reserved. + +# "All problems can be solved by another level of indirection" +# Ideally, this script would not be needed. + +set -e +set -x + +# export http_proxy=... +# export https_proxy=... + +unset ZEPHYR_BASE + +sudo --preserve-env=http_proxy,https_proxy apt-get update +sudo --preserve-env=http_proxy,https_proxy apt-get -y install libssl-dev + +# Make sure we're in the right place; chgrp -R below. +test -e ./scripts/xtensa-build-zephyr.sh + +if test -e zephyrproject; then + ./scripts/xtensa-build-zephyr.sh -a +else + # Matches docker.io/zephyrprojectrtos/zephyr-build:latest gid + ls -ln | head + stat . + sudo chgrp -R 1000 . + sudo chmod -R g+rwX . + ./scripts/xtensa-build-zephyr.sh -a -c +fi