@@ -14,21 +14,27 @@ jobs:
14
14
strategy :
15
15
fail-fast : false
16
16
matrix :
17
- targets :
18
- [
19
- ' x86_64-apple-darwin' ,
20
- ' aarch64-apple-darwin' ,
21
- ' x86_64-pc-windows-msvc' ,
22
- ' i686-pc-windows-msvc' ,
23
- ' aarch64-pc-windows-msvc' ,
24
- ' x86_64-unknown-linux-gnu' ,
25
- ' aarch64-unknown-linux-gnu' ,
26
- ' x86_64-unknown-linux-musl' ,
27
- ' aarch64-unknown-linux-musl' ,
28
- ' armv7-unknown-linux-gnueabihf' ,
29
- ' aarch64-linux-android' ,
30
- ' armv7-linux-androideabi' ,
31
- ]
17
+ settings :
18
+ - target : x86_64-apple-darwin
19
+ flags : ' -x'
20
+ - target : aarch64-apple-darwin
21
+ flags : ' -x'
22
+ - target : x86_64-pc-windows-msvc
23
+ flags : ' -x'
24
+ - target : i686-pc-windows-msvc
25
+ flags : ' -x'
26
+ - target : aarch64-pc-windows-msvc
27
+ flags : ' -x'
28
+ - target : x86_64-unknown-linux-gnu
29
+ flags : ' --use-napi-cross'
30
+ - target : aarch64-unknown-linux-gnu
31
+ flags : ' --use-napi-cross'
32
+ - target : x86_64-unknown-linux-musl
33
+ flags : ' -x'
34
+ - target : aarch64-unknown-linux-musl
35
+ flags : ' -x'
36
+ - target : armv7-unknown-linux-gnueabihf
37
+ flags : ' --use-napi-cross'
32
38
runs-on : ubuntu-latest
33
39
steps :
34
40
- uses : actions/checkout@v4
@@ -40,33 +46,33 @@ jobs:
40
46
${{ github.workspace }}/.xwin
41
47
~/.napi-rs
42
48
./target
43
- key : ${{ matrix.targets }}-cargo-cache
49
+ key : ${{ matrix.settings.target }}-cargo-cache
44
50
- name : Install
45
51
uses : dtolnay/rust-toolchain@stable
46
52
with :
47
53
toolchain : stable
48
- targets : ${{ matrix.targets }}
54
+ targets : ${{ matrix.settings.target }}
49
55
- uses : actions/setup-node@v4
50
56
with :
51
- node-version : ' 20 '
57
+ node-version : ' 22 '
52
58
cache : ' yarn'
53
59
- name : Install ziglang
54
60
uses : goto-bus-stop/setup-zig@v1
55
61
with :
56
- version : 0.13.0
62
+ version : 0.14.1
57
63
- name : Install cargo toolchains
58
64
uses : taiki-e/install-action@v2
59
65
env :
60
66
GITHUB_TOKEN : ${{ github.token }}
61
67
with :
62
68
tool : cargo-zigbuild,cargo-xwin
63
69
- run : yarn install
64
- - run : yarn workspace @napi-cross-build/01-pure-rust build --target ${{ matrix.targets }}
70
+ - run : yarn workspace @napi-cross-build/01-pure-rust build --target ${{ matrix.settings.target }} ${{ matrix.settings.flags }}
65
71
env :
66
72
XWIN_CACHE_DIR : ${{ github.workspace }}/.xwin
67
73
- uses : actions/upload-artifact@v4
68
74
with :
69
- name : bindings-${{ matrix.targets }}
75
+ name : bindings-${{ matrix.settings.target }}
70
76
path : 01-pure-rust/*.node
71
77
if-no-files-found : error
72
78
test-host :
@@ -76,30 +82,30 @@ jobs:
76
82
settings :
77
83
- target : x86_64-apple-darwin
78
84
host : macos-latest
85
+ architecture : x64
79
86
- target : aarch64-apple-darwin
80
87
host : macos-latest
88
+ architecture : arm64
81
89
- target : x86_64-pc-windows-msvc
82
90
host : windows-latest
91
+ architecture : x64
92
+ - target : aarch64-pc-windows-msvc
93
+ host : windows-11-arm
94
+ architecture : arm64
83
95
- target : i686-pc-windows-msvc
84
96
host : windows-latest
85
- node : ['18', '20']
97
+ architecture : x64
98
+ node : ['20', '22']
86
99
runs-on : ${{ matrix.settings.host }}
87
100
needs :
88
101
- build
89
102
steps :
90
103
- uses : actions/checkout@v4
91
104
- uses : actions/setup-node@v4
92
- if : matrix.settings.target != 'aarch64-apple-darwin'
93
- with :
94
- node-version : ${{ matrix.node }}
95
- cache : ' yarn'
96
- architecture : x64
97
- - uses : actions/setup-node@v4
98
- if : matrix.settings.target == 'aarch64-apple-darwin'
99
105
with :
100
106
node-version : ${{ matrix.node }}
101
107
cache : ' yarn'
102
- architecture : arm64
108
+ architecture : ${{ matrix.settings.architecture }}
103
109
- name : Setup node x86
104
110
if : matrix.settings.target == 'i686-pc-windows-msvc'
105
111
run : yarn config set supportedArchitectures.cpu "ia32"
@@ -110,7 +116,7 @@ jobs:
110
116
uses : actions/setup-node@v4
111
117
if : matrix.settings.target == 'i686-pc-windows-msvc'
112
118
with :
113
- node-version : 20
119
+ node-version : 22
114
120
cache : yarn
115
121
architecture : x86
116
122
- name : Download bindings
@@ -126,28 +132,28 @@ jobs:
126
132
matrix :
127
133
settings :
128
134
- target : x86_64-unknown-linux-gnu
129
- docker : node:18 -slim
135
+ docker : node:22 -slim
130
136
args : ' '
131
137
- target : aarch64-unknown-linux-gnu
132
- docker : node:18 -slim
138
+ docker : node:22 -slim
133
139
args : ' --platform linux/arm64'
134
140
- target : x86_64-unknown-linux-musl
135
- docker : node:18 -alpine
141
+ docker : node:22 -alpine
136
142
args : ' '
137
143
- target : aarch64-unknown-linux-musl
138
- docker : node:18 -alpine
144
+ docker : node:22 -alpine
139
145
args : ' --platform linux/arm64'
140
146
- target : armv7-unknown-linux-gnueabihf
141
- docker : node:18 -bullseye-slim
147
+ docker : node:22 -bullseye-slim
142
148
args : ' --platform linux/arm/v7'
143
- runs-on : ubuntu-latest
149
+ runs-on : ${{ contains(matrix.settings.target, 'aarch64') && ' ubuntu-24.04-arm' || 'ubuntu- latest' }}
144
150
needs :
145
151
- build
146
152
steps :
147
153
- uses : actions/checkout@v4
148
154
- uses : actions/setup-node@v4
149
155
with :
150
- node-version : 20
156
+ node-version : 22
151
157
cache : ' yarn'
152
158
- name : Install dependencies
153
159
run : yarn install
@@ -157,10 +163,12 @@ jobs:
157
163
name : bindings-${{ matrix.settings.target }}
158
164
path : 01-pure-rust/
159
165
- name : Set up QEMU
166
+ if : ${{ !contains(matrix.settings.target, 'aarch64') }}
160
167
uses : docker/setup-qemu-action@v3
161
168
with :
162
169
platforms : arm64,arm
163
170
- run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
171
+ if : ${{ !contains(matrix.settings.target, 'aarch64') }}
164
172
- name : Run tests
165
173
uses : addnab/docker-run-action@v3
166
174
with :
0 commit comments