Skip to content

Commit d4fe99f

Browse files
committed
test zephyrproject-rtos/ci-base image
1 parent 9271ec3 commit d4fe99f

File tree

2 files changed

+37
-59
lines changed

2 files changed

+37
-59
lines changed

.github/workflows/compilation_on_zephyr.yml

Lines changed: 35 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -56,72 +56,47 @@ permissions:
5656

5757
jobs:
5858
smoke_test:
59-
runs-on: ubuntu-latest
59+
runs-on: ubuntu-22.04
60+
container:
61+
# For Zephyr 3.7 LTS, use the v0.26-branch or the latest v0.26.x release Docker image.
62+
# ci require a larger runner to avoid "no space left on device"
63+
image: ghcr.io/zephyrproject-rtos/ci-base:v0.26-branch
64+
options: --user root
65+
6066
steps:
67+
# https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-application
68+
# zephyrproject/ --> CI ROOT
69+
# ├─── .west/
70+
# │ └─── config
71+
# ├─── bootloader/
72+
# ├─── zephyr/ --> Zephyr source code
73+
# ├─── modules/
74+
# │ |─── wasm-micro-runtime --> WAMR source code
75+
# ├─── tools/
76+
# ├─── vendor/
77+
# └─── application/ --> DUMMY. keep west_lite.yml here
78+
6179
- name: Checkout code
6280
uses: actions/checkout@v3
81+
with:
82+
path: modules/wasm-micro-runtime
6383

64-
- name: Install dependencies for Zephyr
65-
shell: bash
66-
run: |
67-
sudo apt-get update
68-
sudo apt-get install -y --no-install-recommends git cmake ninja-build gperf \
69-
ccache dfu-util device-tree-compiler wget \
70-
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
71-
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
72-
sudo apt-get clean -y
73-
74-
- name: Download Zephyr SDK
75-
shell: bash
76-
run: |
77-
cd /opt
78-
sudo wget --progress=dot:giga https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ env.ZEPHYR_SDK_VERSION }}/zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}_linux-x86_64.tar.xz
79-
sudo wget --progress=dot:giga -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ env.ZEPHYR_SDK_VERSION }}/sha256.sum | shasum --check --ignore-missing
80-
sudo tar xf zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}_linux-x86_64.tar.xz
81-
working-directory: /opt
82-
83-
- name: Install Zephyr SDK. host tools and Zephyr SDK CMake package
84-
shell: bash
85-
run: |
86-
sudo ./setup.sh -h -c
87-
working-directory: /opt/zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}
88-
89-
- name: Setup Zephyr
90-
shell: bash
91-
run: |
92-
pip3 install west
93-
94-
- name: Generate a minimum Zephyr project
84+
- name: Prepare Zephyr environment
9585
shell: bash
9686
run: |
97-
mkdir -p ./zephyrproject/modules/zephyr
98-
mkdir -p ./zephyrproject/smoke-test
99-
cp product-mini/platforms/zephyr/simple/west_lite.yml ./zephyrproject/smoke-test/west.yml
87+
mkdir -p dummy
88+
cp modules/wasm-micro-runtime/product-mini/platforms/zephyr/simple/west_lite.yml dummy/west_lite.yml
10089
101-
- name: Initialize west
102-
shell: bash
103-
run: |
104-
west init -l .
105-
working-directory: ./zephyrproject/smoke-test
106-
107-
- name: Update west to fetch the Zephyr project
108-
shell: bash
109-
run: west update --stats
110-
working-directory: ./zephyrproject
111-
112-
- name: Export Zephyr environment
113-
shell: bash
114-
run: |
115-
west zephyr-export
116-
pip3 install -r ./scripts/requirements.txt
117-
working-directory: ./zephyrproject/modules/zephyr
118-
119-
- name: Set Environment Variables
120-
shell: bash
121-
run: |
122-
echo "ZEPHYR_BASE=$(realpath ./zephyrproject/modules/zephyr)" >> $GITHUB_ENV
90+
- name: Setup Zephyr project
91+
uses: zephyrproject-rtos/action-zephyr-setup@v1
92+
with:
93+
app-path: dummy
94+
manifest-file-name: west_lite.yml
95+
sdk-version: ${{ env.ZEPHYR_SDK_VERSION }}
96+
toolchains: arc-zephyr-elf:arc64-zephyr-elf
12397

12498
- name: Build a sample application(simple)
99+
shell: bash
125100
run: |
126101
pushd product-mini/platforms/zephyr/simple
127102
west build . -b qemu_arc/qemu_arc_hs -p always -- -DWAMR_BUILD_TARGET=ARC
@@ -134,8 +109,10 @@ jobs:
134109
product-mini/platforms/zephyr/simple/build/zephyr/zephyr.elf &
135110
sleep 5
136111
pkill qemu-system-arc
112+
working-directory: modules/wasm-micro-runtime
137113

138114
- name: Build a sample application(user-mode)
115+
shell: bash
139116
run: |
140117
pushd product-mini/platforms/zephyr/user-mode
141118
west build . -b qemu_arc/qemu_arc_hs -p always -- -DWAMR_BUILD_TARGET=ARC
@@ -148,3 +125,4 @@ jobs:
148125
product-mini/platforms/zephyr/user-mode/build/zephyr/zephyr.elf &
149126
sleep 5
150127
pkill qemu-system-arc
128+
working-directory: modules/wasm-micro-runtime

product-mini/platforms/zephyr/simple/west_lite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ manifest:
88
url: https://github.com/zephyrproject-rtos/zephyr
99
revision: v3.7.0
1010
clone-depth: 1
11-
path: modules/zephyr
11+
path: zephyr
1212
west-commands: scripts/west-commands.yml
1313

1414
self:
15-
path: smoke-test
15+
path: application

0 commit comments

Comments
 (0)