Skip to content

Commit e54858c

Browse files
Eric Migicovskyclaude
andcommitted
ci: auto-run the hardware-lab release-QA on each firmware PR
After build-qa-firmware produces the dual-slot artifact, dispatch coredevices/unicorn's one-off-pebbleos-test against this run's qa-firmware-<board> (erase -> PRF -> pair -> OTA -> functional pass on a real phone + watch), using the most recently tagged coreapp release. The unicorn run posts a unicorn/release-qa commit status back on the PR commit. Gated to org members / collaborators (author_association OWNER/MEMBER/COLLABORATOR) on internal PRs only, so an outside contributor can't spend the single hardware lab. Per-PR concurrency so a newer push supersedes the older dispatch. Requires UNICORN_DISPATCH_TOKEN (a PAT with actions:write on coredevices/unicorn); without it the job no-ops with a warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Eric Migicovsky <eric@repebble.com>
1 parent 2940481 commit e54858c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/build-firmware.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,40 @@ jobs:
194194
name: qa-firmware-${{ steps.artifact_board.outputs.NAME }}
195195
path: out/**
196196

197+
# Once the dual-slot QA firmware is built, kick off the hardware-lab release-QA in
198+
# coredevices/unicorn against THIS run's qa-firmware artifact (erase -> PRF -> pair -> OTA ->
199+
# functional pass on a real phone + watch), using the most recently tagged coreapp release. The
200+
# unicorn run posts a `unicorn/release-qa` commit status back on this PR's commit. Internal PRs
201+
# only (forks have no secrets); needs UNICORN_DISPATCH_TOKEN — a PAT with actions:write on unicorn.
202+
dispatch-release-qa:
203+
needs: build-qa-firmware
204+
# Org members / collaborators only: author_association is MEMBER for org members, OWNER for the
205+
# repo owner, COLLABORATOR for added collaborators — external contributors (CONTRIBUTOR/NONE) are
206+
# excluded, so an outside PR can't spend the hardware lab.
207+
if: >-
208+
github.event_name == 'pull_request' &&
209+
needs.build-qa-firmware.result == 'success' &&
210+
github.event.pull_request.head.repo.full_name == github.repository &&
211+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)
212+
runs-on: ubuntu-24.04
213+
# One in-flight QA per PR: a newer push supersedes the older dispatch instead of queueing extras.
214+
concurrency:
215+
group: release-qa-dispatch-${{ github.event.pull_request.number }}
216+
cancel-in-progress: true
217+
steps:
218+
- name: Dispatch the hardware-lab release-QA (coredevices/unicorn)
219+
env:
220+
GH_TOKEN: ${{ secrets.UNICORN_DISPATCH_TOKEN }}
221+
run: |
222+
if [ -z "${GH_TOKEN:-}" ]; then
223+
echo "::warning::UNICORN_DISPATCH_TOKEN not set — add a PAT with actions:write on coredevices/unicorn to run the hardware release-QA automatically"
224+
exit 0
225+
fi
226+
# to_pbz_run_id = this Build Firmware run (its qa-firmware-<board> artifact is the "to").
227+
# coreapp_run_id omitted -> unicorn uses the most recently tagged coreapp release.
228+
gh workflow run one-off-pebbleos-test.yml -R coredevices/unicorn \
229+
-f to_pbz_run_id=${{ github.run_id }}
230+
197231
build-firmware-status:
198232
needs: [changes-firmware, build-firmware]
199233
if: always()

0 commit comments

Comments
 (0)