Skip to content

Commit 2ad94f9

Browse files
committed
ci: use repo variables for runner selection (Blacksmith + fork compat)
Use `vars.RUNNER_AMD64` and `vars.RUNNER_ARM64` repo variables to select CI runners, with GitHub-hosted runners as fallback defaults. On dashpay/dash, set these variables to Blacksmith runner labels for faster builds. On forks (where the variables aren't set), CI automatically falls back to standard GitHub-hosted runners with no degradation. Changes: - build.yml: check-skip + all sub-workflow calls now explicitly pass runs-on using ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }} or ARM64 - build-container.yml: runner selection via vars with fallback - build-depends.yml, build-src.yml, test-src.yml: defaults reverted to ubuntu-24.04 (callers always pass explicitly now) - cache-depends-sources.yml: vars with fallback - lint.yml: vars with fallback To enable Blacksmith on a repo, set these repository variables: - RUNNER_AMD64=blacksmith-4vcpu-ubuntu-2404 - RUNNER_ARM64=blacksmith-4vcpu-ubuntu-2404-arm
1 parent 5386751 commit 2ad94f9

File tree

7 files changed

+44
-22
lines changed

7 files changed

+44
-22
lines changed

.github/workflows/build-container.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
build-amd64:
2525
name: Build container (amd64)
26-
runs-on: blacksmith-4vcpu-ubuntu-2404
26+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
2727
outputs:
2828
tag: ${{ steps.prepare.outputs.tag }}
2929
repo: ${{ steps.prepare.outputs.repo }}
@@ -43,7 +43,7 @@ jobs:
4343
echo "repo=${REPO_NAME}" >> "$GITHUB_OUTPUT"
4444
4545
- name: Set up Docker Buildx
46-
uses: useblacksmith/setup-docker-builder@v1
46+
uses: docker/setup-buildx-action@v3
4747

4848
- name: Login to GitHub Container Registry
4949
uses: docker/login-action@v3
@@ -54,18 +54,22 @@ jobs:
5454

5555
- name: Build and push Docker image
5656
id: build
57-
uses: useblacksmith/build-push-action@v2
57+
uses: docker/build-push-action@v6
5858
with:
5959
context: ${{ inputs.context }}
6060
file: ${{ inputs.file }}
6161
push: true
6262
platforms: linux/amd64
6363
tags: |
6464
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-amd64
65+
cache-from: |
66+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-amd64
67+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }}
68+
cache-to: type=inline
6569

6670
build-arm64:
6771
name: Build container (arm64)
68-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
72+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
6973
outputs:
7074
digest: ${{ steps.build.outputs.digest }}
7175
steps:
@@ -83,7 +87,7 @@ jobs:
8387
echo "repo=${REPO_NAME}" >> "$GITHUB_OUTPUT"
8488
8589
- name: Set up Docker Buildx
86-
uses: useblacksmith/setup-docker-builder@v1
90+
uses: docker/setup-buildx-action@v3
8791

8892
- name: Login to GitHub Container Registry
8993
uses: docker/login-action@v3
@@ -94,18 +98,22 @@ jobs:
9498

9599
- name: Build and push Docker image
96100
id: build
97-
uses: useblacksmith/build-push-action@v2
101+
uses: docker/build-push-action@v6
98102
with:
99103
context: ${{ inputs.context }}
100104
file: ${{ inputs.file }}
101105
push: true
102106
platforms: linux/arm64
103107
tags: |
104108
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-arm64
109+
cache-from: |
110+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-arm64
111+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }}
112+
cache-to: type=inline
105113

106114
create-manifest:
107115
name: Create multi-arch manifest
108-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
116+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
109117
needs: [build-amd64, build-arm64]
110118
steps:
111119
- name: Checkout code
@@ -114,7 +122,7 @@ jobs:
114122
ref: ${{ github.event.pull_request.head.sha }}
115123

116124
- name: Set up Docker Buildx
117-
uses: useblacksmith/setup-docker-builder@v1
125+
uses: docker/setup-buildx-action@v3
118126

119127
- name: Login to GitHub Container Registry
120128
uses: docker/login-action@v3

.github/workflows/build-depends.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ on:
1313
type: string
1414
runs-on:
1515
description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)"
16-
required: false
17-
default: blacksmith-4vcpu-ubuntu-2404
16+
required: true
1817
type: string
1918
outputs:
2019
key:

.github/workflows/build-src.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ on:
2626
default: ""
2727
runs-on:
2828
description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)"
29-
required: false
30-
default: blacksmith-4vcpu-ubuntu-2404
29+
required: true
3130
type: string
3231
outputs:
3332
key:

.github/workflows/build.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency:
2020
jobs:
2121
check-skip:
2222
name: Check skip conditions
23-
runs-on: blacksmith-4vcpu-ubuntu-2404
23+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
2424
outputs:
2525
skip: ${{ steps.skip-check.outputs.skip }}
2626
steps:
@@ -71,6 +71,7 @@ jobs:
7171
with:
7272
build-target: aarch64-linux
7373
container-path: ${{ needs.container.outputs.path }}
74+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
7475

7576
depends-linux64:
7677
name: x86_64-pc-linux-gnu
@@ -84,6 +85,7 @@ jobs:
8485
with:
8586
build-target: linux64
8687
container-path: ${{ needs.container.outputs.path }}
88+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
8789

8890
depends-linux64_multiprocess:
8991
name: linux64_multiprocess
@@ -95,7 +97,7 @@ jobs:
9597
with:
9698
build-target: linux64_multiprocess
9799
container-path: ${{ needs.container.outputs.path }}
98-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
100+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
99101

100102
depends-linux64_nowallet:
101103
name: x86_64-pc-linux-gnu_nowallet
@@ -105,6 +107,7 @@ jobs:
105107
with:
106108
build-target: linux64_nowallet
107109
container-path: ${{ needs.container.outputs.path }}
110+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
108111

109112
depends-mac:
110113
name: x86_64-apple-darwin
@@ -114,6 +117,7 @@ jobs:
114117
with:
115118
build-target: mac
116119
container-path: ${{ needs.container.outputs.path }}
120+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
117121

118122
depends-win64:
119123
name: x86_64-w64-mingw32
@@ -123,6 +127,7 @@ jobs:
123127
with:
124128
build-target: win64
125129
container-path: ${{ needs.container.outputs.path }}
130+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
126131

127132
lint:
128133
name: Lint
@@ -141,6 +146,7 @@ jobs:
141146
depends-key: ${{ needs.depends-aarch64-linux.outputs.key }}
142147
depends-host: ${{ needs.depends-aarch64-linux.outputs.host }}
143148
depends-dep-opts: ${{ needs.depends-aarch64-linux.outputs.dep-opts }}
149+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
144150

145151
src-linux64:
146152
name: linux64-build
@@ -153,6 +159,7 @@ jobs:
153159
depends-key: ${{ needs.depends-linux64.outputs.key }}
154160
depends-host: ${{ needs.depends-linux64.outputs.host }}
155161
depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }}
162+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
156163

157164
src-linux64_fuzz:
158165
name: linux64_fuzz-build
@@ -165,6 +172,7 @@ jobs:
165172
depends-key: ${{ needs.depends-linux64.outputs.key }}
166173
depends-host: ${{ needs.depends-linux64.outputs.host }}
167174
depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }}
175+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
168176

169177
src-linux64_multiprocess:
170178
name: linux64_multiprocess-build
@@ -177,7 +185,7 @@ jobs:
177185
depends-key: ${{ needs.depends-linux64_multiprocess.outputs.key }}
178186
depends-host: ${{ needs.depends-linux64_multiprocess.outputs.host }}
179187
depends-dep-opts: ${{ needs.depends-linux64_multiprocess.outputs.dep-opts }}
180-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
188+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
181189

182190
src-linux64_nowallet:
183191
name: linux64_nowallet-build
@@ -189,6 +197,7 @@ jobs:
189197
depends-key: ${{ needs.depends-linux64_nowallet.outputs.key }}
190198
depends-host: ${{ needs.depends-linux64_nowallet.outputs.host }}
191199
depends-dep-opts: ${{ needs.depends-linux64_nowallet.outputs.dep-opts }}
200+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
192201

193202
src-linux64_sqlite:
194203
name: linux64_sqlite-build
@@ -201,6 +210,7 @@ jobs:
201210
depends-key: ${{ needs.depends-linux64.outputs.key }}
202211
depends-host: ${{ needs.depends-linux64.outputs.host }}
203212
depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }}
213+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
204214

205215
src-linux64_tsan:
206216
name: linux64_tsan-build
@@ -213,7 +223,7 @@ jobs:
213223
depends-key: ${{ needs.depends-linux64_multiprocess.outputs.key }}
214224
depends-host: ${{ needs.depends-linux64_multiprocess.outputs.host }}
215225
depends-dep-opts: ${{ needs.depends-linux64_multiprocess.outputs.dep-opts }}
216-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
226+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
217227

218228
src-linux64_ubsan:
219229
name: linux64_ubsan-build
@@ -226,6 +236,7 @@ jobs:
226236
depends-key: ${{ needs.depends-linux64.outputs.key }}
227237
depends-host: ${{ needs.depends-linux64.outputs.host }}
228238
depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }}
239+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
229240

230241
src-mac:
231242
name: mac-build
@@ -237,6 +248,7 @@ jobs:
237248
depends-key: ${{ needs.depends-mac.outputs.key }}
238249
depends-host: ${{ needs.depends-mac.outputs.host }}
239250
depends-dep-opts: ${{ needs.depends-mac.outputs.dep-opts }}
251+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
240252

241253
src-win64:
242254
name: win64-build
@@ -248,6 +260,7 @@ jobs:
248260
depends-key: ${{ needs.depends-win64.outputs.key }}
249261
depends-host: ${{ needs.depends-win64.outputs.host }}
250262
depends-dep-opts: ${{ needs.depends-win64.outputs.dep-opts }}
263+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
251264

252265
test-linux64:
253266
name: linux64-test
@@ -257,6 +270,7 @@ jobs:
257270
bundle-key: ${{ needs.src-linux64.outputs.key }}
258271
build-target: linux64
259272
container-path: ${{ needs.container-slim.outputs.path }}
273+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
260274

261275
test-linux64_multiprocess:
262276
name: linux64_multiprocess-test
@@ -266,7 +280,7 @@ jobs:
266280
bundle-key: ${{ needs.src-linux64_multiprocess.outputs.key }}
267281
build-target: linux64_multiprocess
268282
container-path: ${{ needs.container-slim.outputs.path }}
269-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
283+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
270284

271285
test-linux64_nowallet:
272286
name: linux64_nowallet-test
@@ -276,6 +290,7 @@ jobs:
276290
bundle-key: ${{ needs.src-linux64_nowallet.outputs.key }}
277291
build-target: linux64_nowallet
278292
container-path: ${{ needs.container-slim.outputs.path }}
293+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
279294

280295
test-linux64_sqlite:
281296
name: linux64_sqlite-test
@@ -285,6 +300,7 @@ jobs:
285300
bundle-key: ${{ needs.src-linux64_sqlite.outputs.key }}
286301
build-target: linux64_sqlite
287302
container-path: ${{ needs.container-slim.outputs.path }}
303+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
288304

289305
test-linux64_tsan:
290306
name: linux64_tsan-test
@@ -294,7 +310,7 @@ jobs:
294310
bundle-key: ${{ needs.src-linux64_tsan.outputs.key }}
295311
build-target: linux64_tsan
296312
container-path: ${{ needs.container-slim.outputs.path }}
297-
runs-on: blacksmith-4vcpu-ubuntu-2404-arm
313+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
298314

299315
test-linux64_ubsan:
300316
name: linux64_ubsan-test
@@ -304,3 +320,4 @@ jobs:
304320
bundle-key: ${{ needs.src-linux64_ubsan.outputs.key }}
305321
build-target: linux64_ubsan
306322
container-path: ${{ needs.container-slim.outputs.path }}
323+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}

.github/workflows/cache-depends-sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
cache-sources:
1111
name: Cache depends sources
12-
runs-on: ubuntu-24.04-arm
12+
runs-on: ${{ vars.RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v4

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
lint:
1313
name: Run linters
14-
runs-on: ubuntu-24.04
14+
runs-on: ${{ vars.RUNNER_AMD64 || 'ubuntu-24.04' }}
1515
container:
1616
image: ${{ inputs.container-path }}
1717
options: --user root

.github/workflows/test-src.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ on:
1717
type: string
1818
runs-on:
1919
description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)"
20-
required: false
21-
default: blacksmith-4vcpu-ubuntu-2404
20+
required: true
2221
type: string
2322

2423
env:

0 commit comments

Comments
 (0)