name: Platform IO CI
on: [push]
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: 'true'
      - uses: actions/cache@v4
        with:
          path: |
            ~/.cache/pip
            ~/.platformio/.cache
          key: ${{ runner.os }}-pio          
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.9'
      - name: Install PlatformIO
        run: python -m pip install platformio
      - name: Build firmware
        run: platformio run
      - name: Archive
        uses: actions/upload-artifact@v4
        with:
          name: firmwares.zip
          path: .pio/build/*/firmware.bin
