WIP: ci: a pull request's test on a tester's own hardware, started by a hardware label (fork-local pilot) #213
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!213
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:ci/hardware-test-label"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Testers with a Steam Deck, or an AMD, Intel or 8 GB card, only find out about a PR when someone picks it from the test-request queue by hand. A tester's always-on PC could instead run a PR's test by itself once a maintainer labels it
hardware: <name>, without the PR's code ever running outside that tester's sandbox. This was Hookshot PR #2807 (idea in Hookshot issue 2797), rewritten here for Forgejo Actions.What changed
.forgejo/workflows/hardware-test-label.yml(new) runs onpull_request_target(labeled,synchronize):hardware-test.ymlfrom the default branch for the labelled head, throughPOST /actions/workflows/hardware-test.yml/dispatches.hardware:labels off, reading when each was put on from the issue timeline. It leaves alone a label put on after the push, and does nothing for an older push..forgejo/workflows/hardware-test.yml(new) has three jobs:check: started only by a dispatch from the default branch. The commit must be the PR's head and still carry the label.run: on[self-hosted, linux, longshot-hardware, <name>]withpermissions: {}, no checkout and no token. It checks the PR again after waiting in the queue, then calls the owner'sLONGSHOT_HW_SANDBOX.report: postsresults.txtas quoted text, escaped so it can't close the code fence and @mentions don't ping anyone, and capped after escaping.ghbecamecurlagainst Forgejo's API, withLONGSHOT_HW_TOKENif set and the job's token otherwise (aswebsite.ymldoes). JSON is read withpython3, since the runners have nojq. Labels come off by ID, and the artifact steps use Forgejo'supload-artifact/download-artifactv4. The jobs that don't use hardware run onquick..forgejo/actionlint.yaml: thelongshot-hardwarerunner label.docs/hardware-runners.md(new) covers what a runner owner must set up and why runners go on a tester's fork, not on this repository.docs/test-requests.mdlinks it.tests/test_hardware_test_workflow.py(new) has 32 checks. They cover the safety rules (triggers, no self-hosted runner elsewhere, no token or checkout on the runner, pinned actions, no${{ }}inside scripts) and run each shell step against a stand-incurlthat answers as Forgejo's API.Flags and settings
LONGSHOT_HW_RUNNERS(repository variable)LONGSHOT_HW_TOKEN(repository secret)LONGSHOT_HW_SANDBOX(runner.env)Measurements
CI only, so there's no game measurement.
main:
0c74253d(2026-11-13)this PR: ci/hardware-test-label @ ed8d1409
Hardware: Linux (CachyOS), no runner
Scene: none
Method: python -I -B tests/test_hardware_test_workflow.py; actionlint 1.7.12 with .forgejo/actionlint.yaml
How to reproduce: the same two commands
0c74253dtest_hardware_test_workflow.pyTesting
Tested: the 32 checks above and actionlint. On Hookshot, the GitHub version ran end to end on a fork with a test PR.
Not tested: any of it on Forgejo Actions:
LONGSHOT_HW_TOKENis needed);type: label,body: "1"when a label is put on), which I took from Forgejo's API and haven't seen on a live run;Needs other testers:
longshot-hardwarerunner: label a test PRhardware: <name>, expecting the dispatch, the run in the sandbox and the comment (request to open)Screenshots
Nothing on screen
Risk and rollback
Nothing runs until a repository sets
LONGSHOT_HW_RUNNERSand has a runner with those labels. Without that, a label only leaves a notice. Deleting the two workflow files turns it all off.Reviewer notes
Read
docs/hardware-runners.mdfirst, especially "Register runners on your own fork, not on this repository". It explains why this is a fork-only pilot.Issues
See #
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.ed8d1409569c1c6e31b4View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.