Skip to content

ci(actions): route PR checks to self-hosted runner#3986

Merged
jolestar merged 18 commits intomainfrom
fix/self-hosted-ci-runner
Apr 7, 2026
Merged

ci(actions): route PR checks to self-hosted runner#3986
jolestar merged 18 commits intomainfrom
fix/self-hosted-ci-runner

Conversation

@jolestar
Copy link
Copy Markdown
Contributor

Summary

  • route core PR validation workflows to the self-hosted runner
  • align cross-platform build checks with the available Linux runner footprint
  • fix invalid needs.check_changes references and update actions/setup-node

Why

The repository's Dependabot and normal PR checks were still targeting GitHub-hosted runners (ubuntu-latest, macos-latest, larger-runner). With the current runner setup, those jobs fail before executing useful work. This change points the main PR validation path at the repository's active self-hosted runner so dependency PRs like #3985 can be evaluated again.

Testing

  • actionlint on updated workflows
  • remaining findings are pre-existing shellcheck/style warnings and local action metadata warnings, not workflow graph errors from this change

- move core PR validation workflows from GitHub-hosted runners to self-hosted
- align cross-platform check with the available Linux self-hosted runner
- fix check_build_test needs references and refresh setup-node action
Copilot AI review requested due to automatic review settings March 31, 2026 02:03
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rooch-portal-v2.1 Ready Ready Preview, Comment Apr 5, 2026 2:51am
test-portal Ready Ready Preview, Comment Apr 5, 2026 2:51am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
rooch Ignored Ignored Preview Apr 5, 2026 2:51am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Routes the repository’s PR validation workflows away from GitHub-hosted runners and onto the repository’s self-hosted runner so PR checks can run with the currently available runner footprint.

Changes:

  • Switched multiple PR/push workflows from ubuntu-latest / larger-runner / macos-latest to self-hosted.
  • Simplified cross-platform checks to Linux-only and hard-coded Linux OpenSSL env paths accordingly.
  • Updated Node setup in the SDK/Web test job to actions/setup-node@v4 and corrected needs usage by including check_changes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/validation.yml Routes validation jobs (Dockerfile checks, ShellCheck, Homebrew audit) to the self-hosted runner.
.github/workflows/quick_checks.yml Routes quick PR checks (fmt/license/move constants) to the self-hosted runner.
.github/workflows/dependency-review.yml Routes dependency review job to the self-hosted runner.
.github/workflows/cross_platform_check.yml Removes macOS from the matrix; aligns build/env setup to a Linux self-hosted target.
.github/workflows/codeql.yml Routes CodeQL scanning job to the self-hosted runner.
.github/workflows/check_build_test.yml Routes the main build/test pipeline to self-hosted; fixes needs for check_changes; updates setup-node to v4.
.github/workflows/cancel.yml Routes workflow cancellation job to the self-hosted runner.

@@ -28,7 +28,7 @@ jobs:
# Phase 1: Check changes
check_changes:
name: Check Changes
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These workflows run on pull_request events, and switching to a generic runs-on: self-hosted means untrusted PR code will execute on your self-hosted infrastructure. If this repo accepts PRs from forks/external contributors, consider restricting self-hosted execution (e.g., only when github.event.pull_request.head.repo.fork == false / same-repo PRs) or routing fork PRs to a hardened/ephemeral runner label dedicated to untrusted workloads.

Suggested change
name: Check Changes
name: Check Changes
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false

Copilot uses AI. Check for mistakes.
Comment on lines 39 to 43
matrix:
include:
- os: ubuntu-latest
- os: self-hosted
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
# Temporarily disable Windows due to libgit2_sys linking issues with Rust 1.91
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os: self-hosted in the matrix is not an OS selector; it can match any self-hosted runner (including non-Linux). Several steps/env blocks assume Linux (apt-get, /usr/lib/x86_64-linux-gnu, etc.), so this can mis-schedule or break if additional self-hosted runners exist. Consider using runner labels that pin the platform/arch (e.g., [self-hosted, linux, x64]) or split the matrix into separate runner vs platform keys and gate steps on the platform key.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/codeql.yml Outdated
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: self-hosted
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running CodeQL on pull_request using a generic self-hosted runner has two practical risks: (1) it executes PR-controlled code/tools on your self-hosted machine, and (2) CodeQL analyses can be long-running and may monopolize the shared runner used for core CI. Consider targeting a dedicated, isolated runner label/runner group for CodeQL (separate from PR validation), or gating self-hosted usage to trusted branches/PRs only.

Suggested change
runs-on: self-hosted
runs-on: ubuntu-latest

Copilot uses AI. Check for mistakes.
pull-requests: write

jobs:
dependency-review:
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow is triggered by pull_request and now runs on self-hosted. Dependency review checks PR-provided manifests and can be triggered by forks; running it on a general-purpose self-hosted runner increases exposure of the runner to untrusted inputs. Consider restricting to same-repo PRs or using a hardened/ephemeral runner label dedicated to untrusted PR workflows.

Suggested change
dependency-review:
dependency-review:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}

Copilot uses AI. Check for mistakes.
Comment on lines 9 to 13
jobs:
check_validation_changes:
name: Check Validation Changes
runs-on: ubuntu-latest
runs-on: self-hosted
outputs:
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These jobs run Docker builds on pull_request events and now execute on the shared self-hosted runner. Docker builds for untrusted PRs are a common escalation path on self-hosted runners (e.g., via mounting the Docker socket or abusing build context); please ensure the runner is isolated/ephemeral or restrict these jobs to trusted PRs only (same-repo, label-gated, etc.).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/cancel.yml Outdated
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
runs-on: self-hosted
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cancel job is lightweight but now consumes the self-hosted runner. If the self-hosted runner is a constrained resource for build/test jobs, this can add queueing delays. Consider running cancellation on a separate lightweight runner label/runner group so it doesn't contend with core CI.

Suggested change
runs-on: self-hosted
runs-on: ubuntu-latest

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/quick_checks.yml Outdated
quick_checks:
name: Quick Checks
runs-on: ubuntu-latest
runs-on: self-hosted
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow is intended to be a fast PR gate, but running it on the shared self-hosted runner means it competes with heavier build/test jobs for the same capacity. If runner throughput is a concern, consider targeting a separate lightweight runner label/runner group for quick checks (or keeping it on a GitHub-hosted runner if those are available in this environment).

Suggested change
runs-on: self-hosted
runs-on: ubuntu-latest

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 31, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 4e0b9ac.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

  • .github/workflows/cancel.yml

@jolestar jolestar merged commit b50b66a into main Apr 7, 2026
25 of 28 checks passed
@jolestar jolestar deleted the fix/self-hosted-ci-runner branch April 7, 2026 05:54
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.

2 participants