Skip to content

Sensor Microcontroller CI #17

Sensor Microcontroller CI

Sensor Microcontroller CI #17

name: Sensor Microcontroller CI
on:
workflow_dispatch:
push:
branches:
- "**"
paths:
- "firmware/sensor_microcontroller/**"
- "firmware/shared/**"
pull_request:
branches:
- "**"
paths:
- "firmware/sensor_microcontroller/**"
- "firmware/shared/**"
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
~/.platformio/packages
~/.platformio/platforms
firmware/sensor_microcontroller/.pio/libdeps
firmware/sensor_microcontroller/.pio/build
key: ${{ runner.os }}-pio-sensor-${{ hashFiles('firmware/sensor_microcontroller/platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-sensor-
${{ runner.os }}-pio-
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install PlatformIO Core
run: pip install platformio
- name: Copy custom ROS interfaces
run: |
mkdir -p firmware/sensor_microcontroller/extra_packages
cp -r src/autogiro_interfaces firmware/sensor_microcontroller/extra_packages/
- name: Build PlatformIO Project
run: pio run -e ROS
working-directory: firmware/sensor_microcontroller
- name: Upload firmware
uses: actions/upload-artifact@v4
with:
name: sensor_firmware.uf2
path: firmware/sensor_microcontroller/.pio/build/ROS/firmware.uf2
if-no-files-found: warn