Zephyr CircleCI Example (out of tree application)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.0 | |
jobs: | |
build: | |
docker: | |
- image: teslabs/CUSTOM_IMAGE_NAME:latest | |
steps: | |
- checkout | |
- restore_cache: | |
key: west-{{ checksum "west.yml" }} | |
- run: | |
name: initialize | |
command: | | |
west init -l . | |
cd .. | |
west update | |
- save_cache: | |
key: west-{{ checksum "west.yml" }} | |
paths: | |
- "~/zephyr" | |
- "~/modules" | |
- restore_cache: | |
key: pip-{{ checksum "../zephyr/scripts/requirements.txt" }} | |
- run: | |
name: install Zephyr dependencies | |
command: pip3 install -r ../zephyr/scripts/requirements.txt | |
- save_cache: | |
key: pip-{{ checksum "../zephyr/scripts/requirements.txt" }} | |
paths: | |
- "~/.cache/pip" | |
- run: | |
name: build | |
command: | | |
source env.sh | |
west build | |
- store_artifacts: | |
path: build/zephyr/zephyr.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 | |
ARG DEBIAN_FRONTEND=noninteractive | |
# install dependencies | |
RUN apt-get update && apt-get install -y \ | |
# CircleCI | |
software-properties-common \ | |
wget \ | |
git \ | |
openssh-client \ | |
ca-certificates \ | |
sudo \ | |
# Zephyr | |
cmake \ | |
ninja-build \ | |
python3 \ | |
python3-pip \ | |
device-tree-compiler \ | |
gperf \ | |
&& rm -rf /var/lib/apt/lists/* | |
# install ARM Embedded GCC Toolchain | |
RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 && \ | |
mkdir /tools && \ | |
tar -jxf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 -C /tools && \ | |
rm gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 | |
ENV PATH "/tools/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH" | |
# install West | |
RUN pip3 install west |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb" | |
export GNUARMEMB_TOOLCHAIN_PATH="$(dirname "$(which arm-none-eabi-gcc)")/.." | |
source ../zephyr/zephyr-env.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment