Skip to content

Commit 35fe7e7

Browse files
committed
ci: route heavy workflows to self-hosted runners (Phase 2, fork-gated)
Reclaim GitHub-hosted machine-hours by routing the remaining heavy workflows onto the self-hosted fleet proven out by #439, using the same fork-gated runs-on expression (self-hosted for push/internal-branch PRs, GitHub-hosted fallback for fork PRs). - coin-matrix.yml (coin smoke matrix) -> self-hosted Linux / ubuntu-24.04 fork fallback - codeql-analysis.yml (Analyze legs) -> self-hosted Linux / ubuntu-24.04 fork fallback - attribution-gate.yml -> self-hosted Linux / ubuntu-latest fork fallback - safe-cosmetic-automerge.yml (evaluate) -> self-hosted Linux / ubuntu-24.04 fork fallback Build-env parity with build.yml on the two building jobs (coin-matrix, codeql c-cpp manual): clean stale reused build dir on self-hosted (rm -rf build_<coin> / build_codeql) to avoid stale gtest_discover exit-8, and skip apt system-deps on self-hosted (preinstalled). Per-coin source-presence guards (PR #47) untouched. CI plumbing only, no consensus/coin-tree changes.
1 parent 95b3276 commit 35fe7e7

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/attribution-gate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
jobs:
1616
attribution-gate:
1717
name: attribution-gate
18-
runs-on: ubuntu-latest
18+
runs-on: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted","Linux","X64","c2pool-build"]') || 'ubuntu-latest' }}
1919
steps:
2020
- name: Checkout full history
2121
uses: actions/checkout@v4

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
analyze:
1313
name: Analyze (${{ matrix.language }})
14-
runs-on: ubuntu-24.04
14+
runs-on: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted","Linux","X64","c2pool-build"]') || 'ubuntu-24.04' }}
1515
permissions:
1616
security-events: write
1717
packages: read
@@ -39,7 +39,7 @@ jobs:
3939
queries: security-and-quality
4040

4141
# ── C++ build (manual mode only) ─────────────────────────────────────
42-
- if: matrix.build-mode == 'manual'
42+
- if: matrix.build-mode == 'manual' && runner.environment == 'github-hosted'
4343
name: Install system dependencies
4444
run: |
4545
sudo apt-get update -qq
@@ -71,6 +71,10 @@ jobs:
7171
key: conan2-ubuntu24-gcc13-${{ hashFiles('conanfile.txt') }}
7272
restore-keys: conan2-ubuntu24-gcc13-
7373

74+
- if: matrix.build-mode == 'manual' && runner.environment != 'github-hosted'
75+
name: Clean stale build dir (self-hosted workspace is reused)
76+
run: rm -rf build_codeql
77+
7478
- if: matrix.build-mode == 'manual'
7579
name: Install Conan dependencies
7680
run: |

.github/workflows/coin-matrix.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
jobs:
2121
coin:
2222
name: ${{ matrix.coin }} smoke (Linux x86_64)
23-
runs-on: ubuntu-24.04
23+
runs-on: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted","Linux","X64","c2pool-build"]') || 'ubuntu-24.04' }}
2424
strategy:
2525
fail-fast: false
2626
matrix:
@@ -40,7 +40,7 @@ jobs:
4040
fi
4141
4242
- name: Install system dependencies
43-
if: steps.presence.outputs.exists == '1'
43+
if: steps.presence.outputs.exists == '1' && runner.environment == 'github-hosted'
4444
run: |
4545
sudo apt-get update -qq
4646
sudo apt-get install -y --no-install-recommends \
@@ -70,6 +70,10 @@ jobs:
7070
conan2-ubuntu24-gcc13-${{ matrix.coin }}-
7171
conan2-ubuntu24-gcc13-
7272
73+
- name: Clean stale build dir (self-hosted workspace is reused)
74+
if: steps.presence.outputs.exists == '1' && runner.environment != 'github-hosted'
75+
run: rm -rf build_${{ matrix.coin }}
76+
7377
- name: Conan install
7478
if: steps.presence.outputs.exists == '1'
7579
run: |

.github/workflows/safe-cosmetic-automerge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ concurrency:
5151

5252
jobs:
5353
evaluate:
54-
runs-on: ubuntu-24.04
54+
runs-on: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON('["self-hosted","Linux","X64","c2pool-build"]') || 'ubuntu-24.04' }}
5555
steps:
5656
- name: Evaluate gate and merge if green and authorized
5757
env:

0 commit comments

Comments
 (0)