Skip to content

Commit ada15bc

Browse files
committed
ci: move workflows to repository runners
1 parent d88e722 commit ada15bc

10 files changed

Lines changed: 76 additions & 43 deletions

.github/workflows/ci-self-hosted.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
tests/test_pack_enriched_rows.py \
3737
tests/test_streaming_conveyor_progress.py \
3838
tests/test_process_commits_fail_loud.py \
39-
tests/test_repair_packed_document_boundaries.py
39+
tests/test_repair_packed_document_boundaries.py \
40+
tests/test_workflow_runner_policy.py
4041
git diff --check
4142
4243
linux-portable:
@@ -62,6 +63,7 @@ jobs:
6263
tests/test_data_package_imports.py \
6364
tests/test_streaming_conveyor_progress.py \
6465
tests/test_process_commits_fail_loud.py \
65-
tests/test_repair_packed_document_boundaries.py
66+
tests/test_repair_packed_document_boundaries.py \
67+
tests/test_workflow_runner_policy.py
6668
python -m compileall -q scripts tools/clang_indexer
6769
git diff --check

.github/workflows/e2e-matrix.yml

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
jobs:
30-
# On every push/PR: smoke matrix (912 cells, ubuntu, no real MLX
31-
# training — backend just verifies). Quick gate, ~10 min.
30+
# On every push/PR: smoke matrix (912 cells). The backend imports MLX, so
31+
# this runs on the repository's persistent Apple Silicon runner.
3232
preset-matrix:
33-
name: Preset matrix (smoke, ubuntu)
34-
runs-on: ubuntu-latest
33+
name: Preset matrix (smoke, self-hosted macOS)
34+
runs-on: [self-hosted, macOS, ARM64, cppmega-mlx-macos]
3535
timeout-minutes: 25
3636
strategy:
3737
fail-fast: false
@@ -44,16 +44,19 @@ jobs:
4444
node-version: "22"
4545
cache: "npm"
4646
cache-dependency-path: vbgui/package-lock.json
47-
- uses: actions/setup-python@v5
48-
with:
49-
python-version: "3.13"
47+
- name: Bind repository MLX Python
48+
run: |
49+
python_bin=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
50+
test -x "$python_bin"
51+
echo "VBGUI_E2E_PYTHON=$python_bin" >> "$GITHUB_ENV"
5052
- name: Python deps
5153
run: |
52-
python -m pip install --upgrade pip
53-
pip install -e ".[gui,parquet,widget]"
54-
pip install jsonschema pyarrow tokenizers anywidget
54+
"$VBGUI_E2E_PYTHON" -m pip install --upgrade pip
55+
"$VBGUI_E2E_PYTHON" -m pip install -e ".[gui,parquet,widget]"
56+
"$VBGUI_E2E_PYTHON" -m pip install jsonschema pyarrow tokenizers anywidget
5557
- name: Generate fixtures
56-
run: python tests/fixtures/build_e2e_matrix.py
58+
run: |
59+
"$VBGUI_E2E_PYTHON" tests/fixtures/build_e2e_matrix.py
5760
- name: Vbgui install + typecheck
5861
working-directory: vbgui
5962
env:
@@ -63,7 +66,7 @@ jobs:
6366
npm run typecheck
6467
- name: Playwright browsers
6568
working-directory: vbgui
66-
run: npx playwright install --with-deps chromium
69+
run: npx playwright install chromium
6770
- name: Run preset matrix shard ${{ matrix.shard }}/4
6871
working-directory: vbgui
6972
env:
@@ -87,27 +90,31 @@ jobs:
8790
# Specialised + canvas smoke scenarios — run on every push (lightweight).
8891
specialised:
8992
name: Specialised + canvas smoke
90-
runs-on: ubuntu-latest
93+
runs-on: [self-hosted, macOS, ARM64, cppmega-mlx-macos]
9194
timeout-minutes: 15
9295
steps:
9396
- uses: actions/checkout@v4
9497
- uses: actions/setup-node@v4
9598
with: { node-version: "22", cache: "npm",
9699
cache-dependency-path: vbgui/package-lock.json }
97-
- uses: actions/setup-python@v5
98-
with: { python-version: "3.13" }
100+
- name: Bind repository MLX Python
101+
run: |
102+
python_bin=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
103+
test -x "$python_bin"
104+
echo "VBGUI_E2E_PYTHON=$python_bin" >> "$GITHUB_ENV"
105+
- run: |
106+
"$VBGUI_E2E_PYTHON" -m pip install --upgrade pip
107+
"$VBGUI_E2E_PYTHON" -m pip install -e ".[gui,parquet,widget]"
108+
"$VBGUI_E2E_PYTHON" -m pip install jsonschema pyarrow tokenizers anywidget
99109
- run: |
100-
python -m pip install --upgrade pip
101-
pip install -e ".[gui,parquet,widget]"
102-
pip install jsonschema pyarrow tokenizers anywidget
103-
- run: python tests/fixtures/build_e2e_matrix.py
110+
"$VBGUI_E2E_PYTHON" tests/fixtures/build_e2e_matrix.py
104111
- working-directory: vbgui
105112
env: { NODE_ENV: development }
106113
run: |
107114
npm ci
108115
npm run typecheck
109116
- working-directory: vbgui
110-
run: npx playwright install --with-deps chromium
117+
run: npx playwright install chromium
111118
- working-directory: vbgui
112119
env: { NODE_ENV: development, CI: "1" }
113120
run: |
@@ -131,27 +138,31 @@ jobs:
131138
mini-train-matrix:
132139
name: Mini-train matrix (macOS, nightly)
133140
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
134-
runs-on: macos-latest
141+
runs-on: [self-hosted, macOS, ARM64, cppmega-mlx-macos]
135142
timeout-minutes: 60
136143
steps:
137144
- uses: actions/checkout@v4
138145
- uses: actions/setup-node@v4
139146
with: { node-version: "22", cache: "npm",
140147
cache-dependency-path: vbgui/package-lock.json }
141-
- uses: actions/setup-python@v5
142-
with: { python-version: "3.13" }
148+
- name: Bind repository MLX Python
149+
run: |
150+
python_bin=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
151+
test -x "$python_bin"
152+
echo "VBGUI_E2E_PYTHON=$python_bin" >> "$GITHUB_ENV"
153+
- run: |
154+
"$VBGUI_E2E_PYTHON" -m pip install --upgrade pip
155+
"$VBGUI_E2E_PYTHON" -m pip install -e ".[gui,parquet,widget]"
156+
"$VBGUI_E2E_PYTHON" -m pip install jsonschema pyarrow tokenizers anywidget mlx mlx-lm
143157
- run: |
144-
python -m pip install --upgrade pip
145-
pip install -e ".[gui,parquet,widget]"
146-
pip install jsonschema pyarrow tokenizers anywidget mlx mlx-lm
147-
- run: python tests/fixtures/build_e2e_matrix.py
158+
"$VBGUI_E2E_PYTHON" tests/fixtures/build_e2e_matrix.py
148159
- working-directory: vbgui
149160
env: { NODE_ENV: development }
150161
run: |
151162
npm ci
152163
npm run typecheck
153164
- working-directory: vbgui
154-
run: npx playwright install --with-deps chromium
165+
run: npx playwright install chromium
155166
- working-directory: vbgui
156167
env: { NODE_ENV: development, CI: "1" }
157168
run: |
@@ -172,7 +183,7 @@ jobs:
172183
matrix-report:
173184
name: Matrix report
174185
needs: [preset-matrix, specialised]
175-
runs-on: ubuntu-latest
186+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
176187
if: always()
177188
steps:
178189
- uses: actions/checkout@v4

.github/workflows/gemini-dispatch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
debugger:
2727
if: |-
2828
${{ fromJSON(vars.GEMINI_DEBUG || vars.ACTIONS_STEP_DEBUG || false) }}
29-
runs-on: 'ubuntu-latest'
29+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
3030
permissions:
3131
contents: 'read'
3232
steps:
@@ -58,7 +58,7 @@ jobs:
5858
startsWith(github.event.comment.body || github.event.review.body || github.event.issue.body, '@gemini-cli') &&
5959
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association || github.event.review.author_association || github.event.issue.author_association)
6060
)
61-
runs-on: 'ubuntu-latest'
61+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
6262
permissions:
6363
contents: 'read'
6464
issues: 'write'
@@ -190,7 +190,7 @@ jobs:
190190
- 'plan-execute'
191191
if: |-
192192
${{ always() && !cancelled() && (failure() || needs.dispatch.outputs.command == 'fallthrough') }}
193-
runs-on: 'ubuntu-latest'
193+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
194194
permissions:
195195
contents: 'read'
196196
issues: 'write'

.github/workflows/gemini-invoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818

1919
jobs:
2020
invoke:
21-
runs-on: 'ubuntu-latest'
21+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
2222
permissions:
2323
contents: 'read'
2424
id-token: 'write'

.github/workflows/gemini-plan-execute.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defaults:
1919
jobs:
2020
plan-execute:
2121
timeout-minutes: 30
22-
runs-on: 'ubuntu-latest'
22+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
2323
permissions:
2424
contents: 'write'
2525
id-token: 'write'

.github/workflows/gemini-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818

1919
jobs:
2020
review:
21-
runs-on: 'ubuntu-latest'
21+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
2222
timeout-minutes: 7
2323
permissions:
2424
contents: 'read'

.github/workflows/gemini-scheduled-triage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defaults:
2727

2828
jobs:
2929
triage:
30-
runs-on: 'ubuntu-latest'
30+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
3131
timeout-minutes: 7
3232
permissions:
3333
contents: 'read'
@@ -136,7 +136,7 @@ jobs:
136136
prompt: '/gemini-scheduled-triage'
137137

138138
label:
139-
runs-on: 'ubuntu-latest'
139+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
140140
needs:
141141
- 'triage'
142142
if: |-

.github/workflows/gemini-triage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818

1919
jobs:
2020
triage:
21-
runs-on: 'ubuntu-latest'
21+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
2222
timeout-minutes: 7
2323
outputs:
2424
available_labels: '${{ steps.get_labels.outputs.available_labels }}'
@@ -100,7 +100,7 @@ jobs:
100100
prompt: '/gemini-triage'
101101

102102
label:
103-
runs-on: 'ubuntu-latest'
103+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
104104
needs:
105105
- 'triage'
106106
if: |-

.github/workflows/vbgui-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ concurrency:
2727

2828
jobs:
2929
build:
30-
runs-on: ubuntu-latest
30+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
3131
steps:
3232
- uses: actions/checkout@v4
3333

@@ -75,7 +75,7 @@ jobs:
7575

7676
deploy:
7777
needs: build
78-
runs-on: ubuntu-latest
78+
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
7979
environment:
8080
name: github-pages
8181
url: ${{ steps.deployment.outputs.page_url }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from __future__ import annotations
2+
3+
import re
4+
from pathlib import Path
5+
6+
7+
REPO_ROOT = Path(__file__).resolve().parents[1]
8+
HOSTED_RUNNER = re.compile(
9+
r"^\s*runs-on:\s*.*(?:ubuntu|macos|windows)-latest\s*$",
10+
re.MULTILINE,
11+
)
12+
13+
14+
def test_workflows_do_not_use_github_hosted_runners() -> None:
15+
violations = []
16+
for workflow in sorted((REPO_ROOT / ".github" / "workflows").glob("*.yml")):
17+
if HOSTED_RUNNER.search(workflow.read_text(encoding="utf-8")):
18+
violations.append(workflow.relative_to(REPO_ROOT).as_posix())
19+
20+
assert not violations, f"GitHub-hosted runners are forbidden: {violations}"

0 commit comments

Comments
 (0)