CI/CD Integration
flashbay integrates with your CI/CD pipeline to run tests on real hardware automatically.
Source on GitHub (action) · Source on GitHub (templates)
GitHub Actions
Use the official composite action to flash firmware and capture serial output:
yaml
name: HIL Tests
on: [push]
jobs:
hardware-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build firmware
run: |
# your build step here
idf.py build
- name: Flash and capture serial
uses: flashbay-dev/action@v1
with:
api-key: ${{ secrets.FLASHBAY_API_KEY }}
board: esp32-s3
firmware: build/firmware.bin
serial-timeout: 30s
serial-log: serial-output.txt
- name: Check serial output
run: |
cat serial-output.txt
grep "Ready" serial-output.txtThe action handles the full lifecycle: installs the CLI, creates a session, flashes firmware, captures serial output, and ends the session (even if the job fails).
Action inputs
| Input | Required | Default | Description |
|---|---|---|---|
api-key | Yes | — | flashbay API key |
board | Yes | — | Board type (e.g., esp32-s3) |
firmware | No | — | Path to firmware binary |
serial-timeout | No | 30s | Serial capture duration |
serial-log | No | serial-output.txt | File to save serial output |
cli-version | No | latest | fbay-cli version to install |
Action outputs
| Output | Description |
|---|---|
session-id | The session ID that was created |
serial-log | Path to the serial output log file |
GitLab CI
Use the Python SDK directly in your pipeline:
yaml
hardware-test:
image: python:3.12
stage: test
variables:
FLASHBAY_API_KEY: $FLASHBAY_API_KEY
script:
- pip install flashbay pytest
- idf.py build
- pytest tests/hil/ -v
timeout: 10mHow it works
- Your CI pipeline builds the firmware as usual
- The flashbay action/SDK creates a session and flashes the binary to a real board
- Serial output is captured or your test suite runs against the live board
- The session ends automatically when the step completes
- CI reports pass/fail as normal
Tips
- Set a timeout — a hung board shouldn't block your pipeline forever
- Use the pytest fixture from the Python SDK guide for clean test setup/teardown
- Dedicated API key — create a separate API key for CI with a descriptive name like
GitHub Actions - main repo