-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CI action to build the Zephyr examples * Add CI action to build Pico examples * Use caching to speed things up
- Loading branch information
Showing
10 changed files
with
173 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Install and build Zephyr dependencies | ||
description: Install and build Zephyr dependencies | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends git cmake tar build-essential \ | ||
gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib | ||
shell: bash | ||
|
||
- name: Cache Pico SDK | ||
id: cache-pico-sdk | ||
uses: actions/cache@v4 | ||
with: | ||
path: /opt/pico-sdk | ||
key: pico-sdk-${{ runner.os }} | ||
|
||
- name: Install pico-sdk | ||
if: steps.cache-pico-sdk.outputs.cache-hit != 'true' | ||
run: | | ||
git clone https://github.com/raspberrypi/pico-sdk /opt/pico-sdk | ||
echo "PICO_SDK_PATH=/opt/pico-sdk" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo "PICO_SDK_PATH=/opt/pico-sdk" >> $GITHUB_ENV | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Install and build Zephyr dependencies | ||
description: Install and build Zephyr dependencies | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup environment variables | ||
run: | | ||
echo "SDK_VERSION=0.16.8" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends 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 libmagic1 | ||
shell: bash | ||
- name: Install West | ||
run: pip install west | ||
shell: bash | ||
|
||
- name: Cache SDK | ||
id: cache-zephyr-sdk | ||
uses: actions/cache@v4 | ||
with: | ||
path: /opt/zephyr-sdk-${{env.SDK_VERSION}} | ||
key: zephyr-sdk-${{env.SDK_VERSION}}-${{ runner.os }} | ||
|
||
- name: Install Zephyr SDK | ||
if: steps.cache-zephyr-sdk.outputs.cache-hit != 'true' | ||
run : | | ||
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{env.SDK_VERSION}}/zephyr-sdk-${{env.SDK_VERSION}}_linux-x86_64.tar.xz" | ||
wget -O - "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{env.SDK_VERSION}}/sha256.sum" | shasum --check --ignore-missing | ||
sudo tar xvf "zephyr-sdk-${{env.SDK_VERSION}}_linux-x86_64.tar.xz" --directory /opt/ | ||
shell: bash | ||
|
||
- name: Cache Zephyr RTOS | ||
id: cache-zephyr-rtos | ||
uses: actions/cache@v4 | ||
with: | ||
path: /opt/lf-west-template | ||
key: lf-west-template-${{ runner.os }} | ||
|
||
- name: Download and install Zephyr RTOS with the lf-west-template | ||
if: steps.cache-zephyr-rtos.outputs.cache-hit != 'true' | ||
run: | | ||
cd /opt | ||
git clone https://github.com/lf-lang/lf-west-template && cd lf-west-template | ||
west update | ||
shell: bash | ||
- name: Setup environment variables | ||
run: | | ||
cd "/opt/zephyr-sdk-${{env.SDK_VERSION}}" | ||
sudo ./setup.sh -t all -h -c | ||
echo "ZEPHYR_BASE=/opt/lf-west-template/deps/zephyr" >> $GITHUB_ENV | ||
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${{env.SDK_VERSION}}/" >> $GITHUB_ENV | ||
cd /opt/lf-west-template | ||
west zephyr-export | ||
pip install -r deps/zephyr/scripts/requirements.txt | ||
shell: bash |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Pico examples | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
name: Build Pico examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install dependencies | ||
uses: ./.github/actions/pico | ||
- name: Build examples | ||
run: | | ||
cd examples/pico | ||
cmake -Bbuild && cd build | ||
make | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Zephyr examples | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
name: Build zephyr examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install dependencies | ||
uses: ./.github/actions/zephyr | ||
- name: Build examples | ||
run: | | ||
cd examples/zephyr | ||
./buildAll.sh | ||
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# List of folders | ||
FOLDERS=("blinky" "hello" "basic_federated/federated_sender" "basic_federated/federated_receiver1" "basic_federated/federated_receiver2" ) | ||
|
||
BOARD=frdm_k64f | ||
|
||
# Command to execute in each folder | ||
COMMAND="west build -b $BOARD -p always" | ||
|
||
# Iterate over each folder and execute the command | ||
for dir in "${FOLDERS[@]}"; do | ||
echo "Entering $dir" | ||
pushd $dir | ||
$COMMAND | ||
popd | ||
done |