Skip to content

Commit

Permalink
Build riot examples in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
LasseRosenow committed Oct 28, 2024
1 parent bb60a83 commit ea177f5
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/actions/riot/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Install and build RIOT dependencies
description: Install and build RIOT dependencies
runs:
using: "composite"
steps:
- name: Setup environment variables
run: |
echo "RIOT_VERSION=2024.07" >> $GITHUB_ENV
shell: bash

- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends git gcc-arm-none-eabi make \
gcc-multilib libstdc++-arm-none-eabi-newlib openocd gdb-multiarch \
doxygen wget unzip python3-serial
shell: bash

- name: Cache RIOT
id: cache-riot
uses: actions/cache@v4
with:
path: /opt/RIOT-${{env.RIOT_VERSION}}
key: riot-${{env.RIOT_VERSION}}

- name: Install RIOT
if: steps.cache-riot.outputs.cache-hit != 'true'
run: |
wget -q "https://github.com/RIOT-OS/RIOT/archive/refs/tags/${{env.RIOT_VERSION}}.tar.gz"
sudo tar xvf "${{env.RIOT_VERSION}}.tar.gz" --directory /opt/
shell: bash
25 changes: 25 additions & 0 deletions .github/workflows/riot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: RIOT examples

on:
pull_request:

jobs:
ci:
name: Build RIOT examples
runs-on: ubuntu-latest
env:
RIOT_VERSION: "2024.07"
RIOTBASE: "/opt/RIOT-2024.07"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install dependencies
uses: ./.github/actions/riot

- name: Build examples
run: |
cd examples/riot
./buildAll.sh
19 changes: 19 additions & 0 deletions examples/riot/buildAll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

# List of folders
FOLDERS=("blinky" "hello" )

BOARD=nucleo-f429zi

# Command to execute in each folder
COMMAND="make BOARD=$BOARD all"

# Iterate over each folder and execute the command
for dir in "${FOLDERS[@]}"; do
echo "Entering $dir"
pushd $dir
$COMMAND
popd
done

0 comments on commit ea177f5

Please sign in to comment.