Repository navigation
136 lines (136 loc) · 4.45 KB
/
Copy pathzig-ffi.yml
File metadata and controls
136 lines (136 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# SPDX-License-Identifier: MPL-2.0
name: Zig FFI Build
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
actions: read
contents: read
on:
push:
branches: [main]
paths:
- 'ffi/zig/**'
- '.github/workflows/zig-ffi.yml'
pull_request:
branches: [main]
paths:
- 'ffi/zig/**'
- '.github/workflows/zig-ffi.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Cross-compile from Ubuntu (most targets)
build-cross:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
zig-version: ['0.15.2']
target:
# Linux glibc
- x86_64-linux-gnu
- aarch64-linux-gnu
# Linux musl (Alpine, Docker)
- x86_64-linux-musl
- aarch64-linux-musl
# Windows
- x86_64-windows-gnu
# WASI
- wasm32-wasi
steps:
- name: Checkout proven
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
path: proven
- name: Setup Zig
uses: mlugg/setup-zig@e7d1537c378b83b8049f65dda471d87a2f7b2df2 # v1
with:
version: ${{ matrix.zig-version }}
- name: Build FFI library
working-directory: proven/ffi/zig
run: zig build --build-file build_standalone.zig -Dtarget=${{ matrix.target }}
- name: Run tests (native x86_64-linux only)
if: matrix.target == 'x86_64-linux-gnu'
working-directory: proven/ffi/zig
run: zig build test --build-file build_standalone.zig
- name: Upload artifacts
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
with:
name: proven-ffi-${{ matrix.target }}
path: proven/ffi/zig/zig-out/
# macOS builds (native runners for code signing compatibility)
build-macos:
strategy:
fail-fast: false
matrix:
include:
- os: macos-15-intel
target: x86_64-macos
- os: macos-14
target: aarch64-macos
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- name: Checkout proven
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
path: proven
- name: Setup Zig
uses: mlugg/setup-zig@e7d1537c378b83b8049f65dda471d87a2f7b2df2 # v1
with:
version: '0.15.2'
- name: Build FFI library
working-directory: proven/ffi/zig
run: zig build --build-file build_standalone.zig -Dtarget=${{ matrix.target }}
- name: Run tests
working-directory: proven/ffi/zig
run: zig build test --build-file build_standalone.zig
- name: Upload artifacts
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
with:
name: proven-ffi-${{ matrix.target }}
path: proven/ffi/zig/zig-out/
wasm-browser:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout proven
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
path: proven
- name: Setup Zig
uses: mlugg/setup-zig@e7d1537c378b83b8049f65dda471d87a2f7b2df2 # v1
with:
version: '0.15.2'
- name: Build WASM for browser
working-directory: proven/ffi/zig
run: zig build --build-file build_standalone.zig -Dtarget=wasm32-freestanding -Doptimize=ReleaseSmall
- name: Upload WASM artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
with:
name: proven-wasm-browser
path: proven/ffi/zig/zig-out/lib/*.wasm
release:
runs-on: ubuntu-latest
needs: [build-cross, build-macos, wasm-browser]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
timeout-minutes: 10
steps:
- name: Download all artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
path: artifacts/
- name: List artifacts
run: |
echo "=== All ABI artifacts ==="
find artifacts/ -type f | sort
echo ""
echo "=== Summary ==="
echo "Linux glibc: x86_64, aarch64"
echo "Linux musl: x86_64, aarch64"
echo "macOS: x86_64 (Intel), aarch64 (Apple Silicon)"
echo "Windows: x86_64"
echo "WASM: browser (freestanding), WASI"