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-debian :
82
83
name : ' Debian 10'
97
98
- uses : actions/checkout@v4
98
99
with :
99
100
submodules : recursive
101
+ - uses : ./.github/actions/set-make-job-count
100
102
- name : build
101
- run : ${{env.BUILD_DEFAULT_LINUX}}
103
+ run : ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
102
104
103
105
# See the OS labels and monitor deprecations here:
104
106
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
@@ -125,6 +127,7 @@ jobs:
125
127
path : ~/.ccache
126
128
key : ccache-${{ runner.os }}-build-${{ matrix.os }}-${{ github.sha }}
127
129
restore-keys : ccache-${{ runner.os }}-build-${{ matrix.os }}
130
+ - uses : ./.github/actions/set-make-job-count
128
131
- name : remove bundled packages
129
132
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
130
133
- name : set apt conf
@@ -136,7 +139,7 @@ jobs:
136
139
- name : build
137
140
run : |
138
141
${{env.CCACHE_SETTINGS}}
139
- ${{env.BUILD_DEFAULT_LINUX}}
142
+ ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
140
143
141
144
libwallet-ubuntu :
142
145
name : " Ubuntu 20.04 (libwallet)"
@@ -152,6 +155,7 @@ jobs:
152
155
path : ~/.ccache
153
156
key : ccache-${{ runner.os }}-libwallet-${{ github.sha }}
154
157
restore-keys : ccache-${{ runner.os }}-libwallet-
158
+ - uses : ./.github/actions/set-make-job-count
155
159
- name : remove bundled packages
156
160
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
157
161
- name : set apt conf
@@ -164,7 +168,7 @@ jobs:
164
168
run : |
165
169
${{env.CCACHE_SETTINGS}}
166
170
cmake .
167
- make wallet_api -j4
171
+ make wallet_api -j${{env.MAKE_JOB_COUNT}}
168
172
169
173
test-ubuntu :
170
174
name : " Ubuntu 20.04 (tests)"
@@ -182,6 +186,7 @@ jobs:
182
186
path : ~/.ccache
183
187
key : ccache-${{ runner.os }}-build-ubuntu-latest-${{ github.sha }}
184
188
restore-keys : ccache-${{ runner.os }}-build-ubuntu-latest
189
+ - uses : ./.github/actions/set-make-job-count
185
190
- name : remove bundled packages
186
191
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
187
192
- name : set apt conf
@@ -198,7 +203,7 @@ jobs:
198
203
DNS_PUBLIC : tcp://9.9.9.9
199
204
run : |
200
205
${{env.CCACHE_SETTINGS}}
201
- ${{env.BUILD_DEFAULT_LINUX}}
206
+ ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
202
207
cmake --build build --target test
203
208
204
209
# ARCH="default" (not "native") ensures, that a different execution host can execute binaries compiled elsewhere.
0 commit comments