13
13
# The below variables reduce repetitions across similar targets
14
14
env :
15
15
REMOVE_BUNDLED_PACKAGES : sudo rm -rf /usr/local
16
- BUILD_DEFAULT_LINUX : |
17
- cmake -S . -B build -D ARCH="default" -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release && cmake --build build --parallel 4
16
+ BUILD_DEFAULT_LINUX : ' cmake -S . -B build -D ARCH="default" -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release && cmake --build build'
18
17
APT_INSTALL_LINUX : ' apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler ccache git'
19
18
APT_SET_CONF : |
20
19
tee -a /etc/apt/apt.conf.d/80-custom << EOF
@@ -42,14 +41,15 @@ jobs:
42
41
path : /Users/runner/Library/Caches/ccache
43
42
key : ccache-${{ runner.os }}-build-${{ github.sha }}
44
43
restore-keys : ccache-${{ runner.os }}-build-
44
+ - uses : ./.github/actions/set-make-job-count
45
45
- name : install dependencies
46
46
run : |
47
47
HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi openssl zmq miniupnpc expat libunwind-headers protobuf@21 ccache
48
48
brew link protobuf@21 boost
49
49
- name : build
50
50
run : |
51
51
${{env.CCACHE_SETTINGS}}
52
- make -j3
52
+ make -j${{env.MAKE_JOB_COUNT}}
53
53
54
54
build-windows :
55
55
name : ' Windows (MSYS2)'
@@ -73,10 +73,11 @@ jobs:
73
73
with :
74
74
update : true
75
75
install : mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound git pkg-config
76
+ - uses : ./.github/actions/set-make-job-count
76
77
- name : build
77
78
run : |
78
79
${{env.CCACHE_SETTINGS}}
79
- make release-static-win64 -j4
80
+ make release-static-win64 -j${{env.MAKE_JOB_COUNT}}
80
81
81
82
build-arch :
82
83
name : ' Arch Linux'
@@ -113,8 +114,9 @@ jobs:
113
114
- uses : actions/checkout@v4
114
115
with :
115
116
submodules : recursive
117
+ - uses : ./.github/actions/set-make-job-count
116
118
- name : build
117
- run : ${{env.BUILD_DEFAULT_LINUX}}
119
+ run : ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
118
120
119
121
# See the OS labels and monitor deprecations here:
120
122
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
@@ -141,6 +143,7 @@ jobs:
141
143
path : ~/.ccache
142
144
key : ccache-${{ runner.os }}-build-${{ matrix.os }}-${{ github.sha }}
143
145
restore-keys : ccache-${{ runner.os }}-build-${{ matrix.os }}
146
+ - uses : ./.github/actions/set-make-job-count
144
147
- name : remove bundled packages
145
148
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
146
149
- name : set apt conf
@@ -152,7 +155,7 @@ jobs:
152
155
- name : build
153
156
run : |
154
157
${{env.CCACHE_SETTINGS}}
155
- ${{env.BUILD_DEFAULT_LINUX}}
158
+ ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
156
159
157
160
libwallet-ubuntu :
158
161
name : " Ubuntu 20.04 (libwallet)"
@@ -168,6 +171,7 @@ jobs:
168
171
path : ~/.ccache
169
172
key : ccache-${{ runner.os }}-libwallet-${{ github.sha }}
170
173
restore-keys : ccache-${{ runner.os }}-libwallet-
174
+ - uses : ./.github/actions/set-make-job-count
171
175
- name : remove bundled packages
172
176
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
173
177
- name : set apt conf
@@ -180,7 +184,7 @@ jobs:
180
184
run : |
181
185
${{env.CCACHE_SETTINGS}}
182
186
cmake .
183
- make wallet_api -j4
187
+ make wallet_api -j${{env.MAKE_JOB_COUNT}}
184
188
185
189
test-ubuntu :
186
190
name : " Ubuntu 20.04 (tests)"
@@ -198,6 +202,7 @@ jobs:
198
202
path : ~/.ccache
199
203
key : ccache-${{ runner.os }}-build-ubuntu-latest-${{ github.sha }}
200
204
restore-keys : ccache-${{ runner.os }}-build-ubuntu-latest
205
+ - uses : ./.github/actions/set-make-job-count
201
206
- name : remove bundled packages
202
207
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
203
208
- name : set apt conf
@@ -214,7 +219,7 @@ jobs:
214
219
DNS_PUBLIC : tcp://9.9.9.9
215
220
run : |
216
221
${{env.CCACHE_SETTINGS}}
217
- ${{env.BUILD_DEFAULT_LINUX}}
222
+ ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
218
223
cmake --build build --target test
219
224
220
225
# ARCH="default" (not "native") ensures, that a different execution host can execute binaries compiled elsewhere.
0 commit comments