Sensor Microcontroller CI #17
This file contains hidden or 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
| 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 |