From 0e26636b78ef573349870f8905eac0fbac257449 Mon Sep 17 00:00:00 2001 From: Guybrush Date: Sat, 12 Sep 2026 15:06:35 +0200 Subject: [PATCH] ci: add GitHub Actions build workflow for ESP32 firmware Compiles esp32_usb env on every push to main/feature/** and on PRs to main. Uses secrets templates so no credentials are needed in CI. Includes PlatformIO package cache to keep build times under ~2 min. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a5ef8d1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: Build firmware + +on: + push: + branches: ["main", "feature/**"] + pull_request: + branches: ["main"] + +jobs: + build: + name: Compile ESP32 firmware + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache PlatformIO packages + uses: actions/cache@v4 + with: + path: ~/.platformio + key: pio-${{ hashFiles('platformio.ini') }} + restore-keys: pio- + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install PlatformIO + run: pip install platformio + + - name: Generate secrets.h from template + run: cp src/secrets.h.template src/secrets.h + + - name: Generate secrets.ini from template + run: cp secrets.ini.template secrets.ini + + - name: Build + run: pio run -e esp32_usb + + - name: Report flash and RAM usage + if: success() + run: | + pio run -e esp32_usb 2>&1 | grep -E "RAM:|Flash:" || true