From ea177f5f8d3b0532935496030d527de94194441b Mon Sep 17 00:00:00 2001 From: Lasse Rosenow Date: Mon, 28 Oct 2024 14:20:58 +0000 Subject: [PATCH] Build riot examples in ci --- .github/actions/riot/action.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/riot.yml | 25 +++++++++++++++++++++++++ examples/riot/buildAll.sh | 19 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/actions/riot/action.yml create mode 100644 .github/workflows/riot.yml create mode 100755 examples/riot/buildAll.sh diff --git a/.github/actions/riot/action.yml b/.github/actions/riot/action.yml new file mode 100644 index 00000000..0f10155a --- /dev/null +++ b/.github/actions/riot/action.yml @@ -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 diff --git a/.github/workflows/riot.yml b/.github/workflows/riot.yml new file mode 100644 index 00000000..56f36ce7 --- /dev/null +++ b/.github/workflows/riot.yml @@ -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 diff --git a/examples/riot/buildAll.sh b/examples/riot/buildAll.sh new file mode 100755 index 00000000..5e480172 --- /dev/null +++ b/examples/riot/buildAll.sh @@ -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 \ No newline at end of file