9
9
Build :
10
10
if : ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
11
11
runs-on : ${{ matrix.os }}
12
+ # prettier-ignore
13
+ name : ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.dockerfile }}-${{ matrix.distro }}
12
14
strategy :
13
15
fail-fast : false
14
16
matrix :
@@ -21,11 +23,16 @@ jobs:
21
23
- x64
22
24
dockerfile :
23
25
- " "
26
+ distro :
27
+ - " "
28
+ native :
29
+ - true
24
30
25
31
include :
26
32
- os : windows-2019
27
33
node_arch : ia32
28
34
cpp_arch : amd64_x86
35
+ native : true
29
36
30
37
# - os: windows-2022
31
38
# node_arch: x64
@@ -35,16 +42,33 @@ jobs:
35
42
- os : macos-13
36
43
node_arch : x64
37
44
cpp_arch : x64
45
+ native : true
38
46
39
47
- os : macos-14
40
48
node_arch : arm64
41
49
cpp_arch : amd64_arm64
50
+ native : true
42
51
43
- # Alpine
44
- - os : ubuntu-22 .04
52
+ # Musl Alpine
53
+ - os : ubuntu-24 .04
45
54
dockerfile : docker/alpine.dockerfile
46
55
node_arch : x64
47
56
cpp_arch : x64
57
+ native : false
58
+
59
+ # Debian Arm
60
+ - os : ubuntu-24.04
61
+ node_arch : arm64
62
+ cpp_arch : amd64_arm64
63
+ distro : bookworm
64
+ native : false
65
+
66
+ # Musl Alpine Arm
67
+ - os : ubuntu-24.04
68
+ node_arch : arm64
69
+ cpp_arch : amd64_arm64
70
+ distro : alpine_latest
71
+ native : false
48
72
49
73
env :
50
74
npm_config_arch : ${{ matrix.node_arch }}
59
83
path : |
60
84
./node_modules/
61
85
~/vcpkg
62
- key :
63
- # prettier-ignore
64
- " cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-${{hashFiles('./pnpm-lock.yaml', './vcpkg.json', './CMakeLists.txt') }}"
86
+ # prettier-ignore
87
+ key : " cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-${{hashFiles('./pnpm-lock.yaml', './vcpkg.json', './CMakeLists.txt') }}"
65
88
restore-keys : |
66
89
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-"
67
90
73
96
shell : bash
74
97
75
98
- name : Setup Cpp
76
- if : ${{ ! matrix.dockerfile }}
99
+ if : ${{ matrix.native }}
77
100
uses : aminya/setup-cpp@v1
78
101
with :
79
102
vcvarsall : ${{ contains(matrix.os, 'windows') }}
@@ -89,34 +112,34 @@ jobs:
89
112
brew install gnutls autoconf automake libtool
90
113
91
114
- uses : pnpm/action-setup@v4
92
- if : ${{ ! matrix.dockerfile }}
115
+ if : ${{ matrix.native }}
93
116
with :
94
117
version : 9
95
118
96
119
- name : Install Node 20
97
- if : ${{ ! matrix.dockerfile }}
120
+ if : ${{ matrix.native }}
98
121
uses : actions/setup-node@v4
99
122
with :
100
123
node-version : 20
101
124
architecture : ${{ env.setup_node_arch }}
102
125
103
126
- name : Install and Build Native
104
- if : ${{ ! matrix.dockerfile }}
127
+ if : ${{ matrix.native }}
105
128
run : pnpm install
106
129
107
130
- name : Build JavaScript
108
- if : ${{ ! matrix.dockerfile }}
131
+ if : ${{ matrix.native }}
109
132
run : pnpm run build.js
110
133
111
134
- name : Install Node 10
112
- if : ${{ ! matrix.dockerfile && matrix.os != 'macos-14' }}
135
+ if : ${{ matrix.native && matrix.os != 'macos-14' }}
113
136
uses : actions/setup-node@v4
114
137
with :
115
138
node-version : 10
116
139
architecture : ${{ env.setup_node_arch }}
117
140
118
141
- name : Build Native
119
- if : ${{ ! matrix.dockerfile && matrix.node_arch != 'ia32' }}
142
+ if : ${{ matrix.native && matrix.node_arch != 'ia32' }}
120
143
run : npm run build.native
121
144
122
145
- name : Build Native Windows 32
@@ -126,7 +149,7 @@ jobs:
126
149
windows-x86
127
150
128
151
- name : Use Node 20
129
- if : ${{ ! matrix.dockerfile }}
152
+ if : ${{ matrix.native }}
130
153
uses : actions/setup-node@v4
131
154
with :
132
155
node-version : 20
@@ -137,9 +160,39 @@ jobs:
137
160
run : |
138
161
docker build -t zeromq -f ${{ matrix.dockerfile }} .
139
162
docker create --name zeromq-temp zeromq
140
- docker cp zeromq-temp:/app/build ./build
163
+ mkdir -p ./build
164
+ docker cp zeromq-temp:/app/build ./
141
165
docker rm -f zeromq-temp
142
166
167
+ - name : Read Installer Script
168
+ if : ${{ matrix.distro }}
169
+ id : read-installer-script
170
+ run : |
171
+ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
172
+ echo "install_deps<<$EOF" >> $GITHUB_OUTPUT
173
+ cat ./script/install-deps.sh >> $GITHUB_OUTPUT
174
+ echo "$EOF" >> $GITHUB_OUTPUT
175
+
176
+ - name : Build Linux Arm64
177
+ if : ${{ matrix.distro }}
178
+
179
+ with :
180
+ arch : aarch64
181
+ distro : ${{ matrix.distro }}
182
+ githubToken : ${{ github.token }}
183
+ setup : |
184
+ mkdir -p "${PWD}/build"
185
+ dockerRunArgs : |
186
+ --volume "${PWD}/build:/build"
187
+ env : |
188
+ VCPKG_FORCE_SYSTEM_BINARIES: 1
189
+ install : |
190
+ ${{ steps.read-installer-script.outputs.install_deps }}
191
+
192
+ run : |
193
+ pnpm install && \
194
+ pnpm run build
195
+
143
196
- name : Upload build
144
197
uses : actions/upload-artifact@v4
145
198
with :
@@ -148,11 +201,11 @@ jobs:
148
201
overwrite : true
149
202
150
203
- name : Lint
151
- if : " ${{ contains(matrix.os, 'ubuntu') && ! matrix.dockerfile }}"
204
+ if : " ${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
152
205
run : pnpm run lint-test
153
206
154
207
- name : Test
155
- if : ${{ ! matrix.dockerfile }}
208
+ if : ${{ matrix.native }}
156
209
uses : nick-fields/retry@v3
157
210
with :
158
211
timeout_minutes : 5
@@ -163,7 +216,7 @@ jobs:
163
216
rm -rf ./tmp && mkdir -p ./tmp
164
217
165
218
- name : Test Electron Windows/MacOS
166
- if : " ${{ !contains(matrix.os, 'ubuntu') && ! matrix.dockerfile }}"
219
+ if : " ${{ !contains(matrix.os, 'ubuntu') && matrix.native }}"
167
220
uses : nick-fields/retry@v3
168
221
with :
169
222
timeout_minutes : 5
@@ -173,7 +226,7 @@ jobs:
173
226
continue-on-error : true
174
227
175
228
- name : Test Electron Linux
176
- if : " ${{ contains(matrix.os, 'ubuntu') && ! matrix.dockerfile }}"
229
+ if : " ${{ contains(matrix.os, 'ubuntu') && matrix.native }}"
177
230
uses : nick-fields/retry@v3
178
231
with :
179
232
timeout_minutes : 5
0 commit comments