Skip to content

Make Arduino CI opt-in via /run-arduino-tests comment#2537

Merged
joperezr merged 4 commits into
mainfrom
joperezr/arduino-ci-opt-in
May 14, 2026
Merged

Make Arduino CI opt-in via /run-arduino-tests comment#2537
joperezr merged 4 commits into
mainfrom
joperezr/arduino-ci-opt-in

Conversation

@joperezr
Copy link
Copy Markdown
Member

@joperezr joperezr commented May 13, 2026

Why

The Arduino_Compiler_CI GitHub Actions workflow runs on every pull request today, but:

  • It has been flaky for the past few weeks, repeatedly blocking PRs that have nothing to do with the Arduino compiler.
  • It validates a narrow slice of the repo (the Arduino C# compiler under 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.yml no longer triggers on pull_request. Instead it triggers on:

  • workflow_dispatch — manual run from the Actions tab (unchanged).
  • issue_comment — a comment of /run-arduino-tests on a PR.

The workflow now has three jobs:

  1. gate (ubuntu) — validates the trigger:
    • The comment must be on a PR and start with /run-arduino-tests.
    • The commenter must have write or admin permission on the repo (checked via gh api repos/.../collaborators/{user}/permission). Non-collaborators / forks cannot trigger it.
    • Resolves the PR head repo + SHA, reacts to the comment with 🚀, and posts a "build started" comment linking to the run.
  2. build (windows-latest) — checks out the PR head SHA and runs eng/ArduinoCsCI.cmd exactly as before.
  3. 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:

/run-arduino-tests

The workflow will react with 🚀, run the build against the PR head, and post the result back as a comment.

Notes

  • This is not a required status check on main, so removing the pull_request trigger does not block merges.
  • Branch-protection rules are untouched.
  • The underlying flakiness of the Arduino build is out of scope for this PR — this change just stops it from blocking unrelated work.

FYI @pgrawehr @raffaeler @krwq

Microsoft Reviewers: Open in CodeFlow

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>
@pgrawehr
Copy link
Copy Markdown
Contributor

/run-arduino-tests

@raffaeler
Copy link
Copy Markdown
Contributor

/run-arduino-tests

This will work as soon as we merge :)

Comment thread .github/workflows/arduino.yml
Comment thread .github/workflows/arduino.yml Outdated
joperezr and others added 3 commits May 14, 2026 10:12
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>
@raffaeler
Copy link
Copy Markdown
Contributor

@joperezr are you still working on this or we can merge?

@joperezr joperezr merged commit b6aff87 into main May 14, 2026
10 checks passed
@joperezr
Copy link
Copy Markdown
Member Author

Merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants