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