Make Arduino CI opt-in via /run-arduino-tests comment#2537
Merged
Conversation
The Arduino_Compiler_CI workflow has been flaky and only validates a narrow part of the repo (the Arduino compiler), so it no longer runs automatically on every pull request. It now triggers only when a collaborator with write or admin permission comments '/run-arduino-tests' on a PR, or when a maintainer dispatches it manually from the Actions tab. The workflow reacts to the triggering comment with a rocket emoji, posts a 'build started' comment with a link to the run, and posts a final success/failure comment when the build completes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
raffaeler
approved these changes
May 14, 2026
pgrawehr
approved these changes
May 14, 2026
Contributor
|
/run-arduino-tests |
Contributor
This will work as soon as we merge :) |
krwq
reviewed
May 14, 2026
krwq
reviewed
May 14, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a pull_request trigger with a paths filter covering global.json, eng/ArduinoCsCI.cmd, and tools/ArduinoCsCompiler/**. PRs touching any of these still auto-run the check; all other PRs remain opt-in via the /run-arduino-tests comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All PR-side writes in this workflow go through the issues API (POST /repos/.../issues/{n}/comments and POST /repos/.../issues/comments/{id}/reactions), both of which only require issues: write. There are no calls to PR-specific endpoints (reviews, requested-reviewers, merge, labels) that would need pull-requests: write.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
@joperezr are you still working on this or we can merge? |
Member
Author
|
Merged :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
Arduino_Compiler_CIGitHub Actions workflow runs on every pull request today, but:tools/ArduinoCsCompiler/). The overwhelming majority of PRs do not touch code that could affect it.This PR makes the workflow opt-in so it only runs when we actually need it.
What changes
.github/workflows/arduino.ymlno longer triggers onpull_request. Instead it triggers on:workflow_dispatch— manual run from the Actions tab (unchanged).issue_comment— a comment of/run-arduino-testson a PR.The workflow now has three jobs:
gate(ubuntu) — validates the trigger:/run-arduino-tests.writeoradminpermission on the repo (checked viagh api repos/.../collaborators/{user}/permission). Non-collaborators / forks cannot trigger it.build(windows-latest) — checks out the PR head SHA and runseng/ArduinoCsCI.cmdexactly as before.report(ubuntu,if: always()) — posts a final ✅/❌/🚫 comment with the outcome and a link to the run.Workflow permissions are scoped to
contents: read,pull-requests: write,issues: write.How to use
When a PR is touching code that might affect the Arduino compiler (e.g. anything under
tools/ArduinoCsCompiler/or related dependencies), a maintainer just comments:The workflow will react with 🚀, run the build against the PR head, and post the result back as a comment.
Notes
main, so removing thepull_requesttrigger does not block merges.FYI @pgrawehr @raffaeler @krwq
Microsoft Reviewers: Open in CodeFlow