Skip to content

Commit 9ad301e

Browse files
committed
feat: switch to bun-ffi-z target in CI
1 parent fdcc2be commit 9ad301e

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

.github/workflows/test.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515
matrix:
1616
settings:
1717
- os: ubuntu-latest
18-
target: x86_64-linux-gnu
18+
bun-target: linux-x64-gnu
1919
- os: ubuntu-24.04-arm
20-
target: aarch64-linux-gnu
20+
bun-target: linux-arm64-gnu
2121
- os: ubuntu-latest
22-
target: x86_64-linux-musl
22+
bun-target: linux-x64-musl
2323
- os: ubuntu-24.04-arm
24-
target: aarch64-linux-musl
24+
bun-target: linux-arm64-musl
2525
- os: macos-13
26-
target: x86_64-macos-none
26+
bun-target: darwin-x64
2727
- os: macos-latest
28-
target: aarch64-macos-none
28+
bun-target: darwin-arm64
2929
# - os: windows-latest # TODO: https://github.com/ChainSafe/state-transition-z/issues/10
30-
# target: x86_64-windows-msvc
30+
# bun-target: win32-x64-msvc
3131

3232
runs-on: ${{ matrix.settings.os }}
3333

@@ -44,12 +44,19 @@ jobs:
4444
- name: Build and Test
4545
run: |
4646
zig build test
47-
- name: Build binary
48-
run: zig build -Dtarget=${{ matrix.settings.target }} -Doptimize=ReleaseSafe
47+
- name: Install Bun
48+
uses: oven-sh/setup-bun@v2
49+
with:
50+
version: 1.2.13
51+
- name: Bun - Install Dependencies
52+
run: bun install
53+
working-directory: ./bun
54+
- name: Build binary using bun-ffi-z
55+
run: bun ./node_modules/.bin/bun-ffi-z build --target ${{ matrix.settings.bun-target }} --optimize ReleaseSafe
4956
- name: Upload Zig Artifacts
5057
uses: actions/upload-artifact@v4
5158
with:
52-
name: ${{ matrix.settings.target }}
59+
name: ${{ matrix.settings.bun-target }}
5360
path: 'zig-out/lib/*state-transition-utils.*'
5461
if-no-files-found: error
5562

@@ -181,26 +188,26 @@ jobs:
181188
bun install
182189
bun test test/unit/pubkeyIndexMap.test.ts
183190
184-
bun-macos:
191+
bun-darwin:
185192
name: Test bindings on macos
186193
needs: zig-build-upload
187194
strategy:
188195
matrix:
189196
settings:
190197
- os: macos-13
191-
target: x86_64-macos-none
198+
bun-target: darwin-x64
192199
- os: macos-latest
193-
target: aarch64-macos-none
200+
bun-target: darwin-arm64
194201
# - os: windows-latest # TODO: https://github.com/ChainSafe/state-transition-z/issues/10
195-
# target: x86_64-windows-msvc
202+
# bun-target: win32-x64-msvc
196203
runs-on: ${{ matrix.settings.os }}
197204
steps:
198205
- name: Checkout Repository
199206
uses: actions/checkout@v4
200207
- name: Download artifacts
201208
uses: actions/download-artifact@v4 # no need zig installation, download artifacts from previous job instead
202209
with:
203-
name: ${{ matrix.settings.target }}
210+
name: ${{ matrix.settings.bun-target }}
204211
path: zig-out/lib # download to the same folder of "zig build -Doptimize=ReleaseSafe"
205212
- name: Install Bun
206213
uses: oven-sh/setup-bun@v2
@@ -222,7 +229,7 @@ jobs:
222229
- bun-linux-arm64-gnu
223230
- bun-linux-x64-musl
224231
- bun-linux-arm64-musl
225-
- bun-macos
232+
- bun-darwin
226233
steps:
227234
- name: Checkout Repository
228235
uses: actions/checkout@v4

0 commit comments

Comments
 (0)