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
@@ -41,14 +40,15 @@ jobs:
41
40
path : /Users/runner/Library/Caches/ccache
42
41
key : ccache-${{ runner.os }}-build-${{ github.sha }}
43
42
restore-keys : ccache-${{ runner.os }}-build-
43
+ - uses : ./.github/actions/set-make-job-count
44
44
- name : install dependencies
45
45
run : |
46
46
HOMEBREW_NO_AUTO_UPDATE=1 brew install boost@1.85 hidapi openssl zmq miniupnpc expat libunwind-headers protobuf@21 ccache
47
47
brew link protobuf@21 boost@1.85
48
48
- name : build
49
49
run : |
50
50
${{env.CCACHE_SETTINGS}}
51
- make -j3
51
+ make -j${{env.MAKE_JOB_COUNT}}
52
52
53
53
build-windows :
54
54
runs-on : windows-latest
@@ -78,10 +78,11 @@ jobs:
78
78
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-libs-1.86.0-7-any.pkg.tar.zst
79
79
echo "4cb1d1066fffa6a5788b212ccb920c6d8cc93a8ecbbc633565bfc9b2ebc6feb5 mingw-w64-x86_64-boost-libs-1.86.0-7-any.pkg.tar.zst" | sha256sum -c
80
80
pacman --noconfirm -U mingw-w64-x86_64-boost-1.86.0-7-any.pkg.tar.zst mingw-w64-x86_64-boost-libs-1.86.0-7-any.pkg.tar.zst
81
+ - uses : ./.github/actions/set-make-job-count
81
82
- name : build
82
83
run : |
83
84
${{env.CCACHE_SETTINGS}}
84
- make release-static-win64 -j4
85
+ make release-static-win64 -j${{env.MAKE_JOB_COUNT}}
85
86
86
87
build-debian :
87
88
name : ' build-debian (debian-10)'
@@ -102,8 +103,9 @@ jobs:
102
103
- uses : actions/checkout@v4
103
104
with :
104
105
submodules : recursive
106
+ - uses : ./.github/actions/set-make-job-count
105
107
- name : build
106
- run : ${{env.BUILD_DEFAULT_LINUX}}
108
+ run : ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
107
109
108
110
# See the OS labels and monitor deprecations here:
109
111
# 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
runs-on : ubuntu-20.04
@@ -151,6 +154,7 @@ jobs:
151
154
path : ~/.ccache
152
155
key : ccache-${{ runner.os }}-libwallet-${{ github.sha }}
153
156
restore-keys : ccache-${{ runner.os }}-libwallet-
157
+ - uses : ./.github/actions/set-make-job-count
154
158
- name : remove bundled packages
155
159
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
156
160
- name : set apt conf
@@ -163,7 +167,7 @@ jobs:
163
167
run : |
164
168
${{env.CCACHE_SETTINGS}}
165
169
cmake .
166
- make wallet_api -j4
170
+ make wallet_api -j${{env.MAKE_JOB_COUNT}}
167
171
168
172
test-ubuntu :
169
173
needs : build-ubuntu
@@ -180,6 +184,7 @@ jobs:
180
184
path : ~/.ccache
181
185
key : ccache-${{ runner.os }}-build-ubuntu-latest-${{ github.sha }}
182
186
restore-keys : ccache-${{ runner.os }}-build-ubuntu-latest
187
+ - uses : ./.github/actions/set-make-job-count
183
188
- name : remove bundled packages
184
189
run : ${{env.REMOVE_BUNDLED_PACKAGES}}
185
190
- name : set apt conf
@@ -196,7 +201,7 @@ jobs:
196
201
DNS_PUBLIC : tcp://9.9.9.9
197
202
run : |
198
203
${{env.CCACHE_SETTINGS}}
199
- ${{env.BUILD_DEFAULT_LINUX}}
204
+ ${{env.BUILD_DEFAULT_LINUX}} --parallel ${{env.MAKE_JOB_COUNT}}
200
205
cmake --build build --target test
201
206
202
207
# ARCH="default" (not "native") ensures, that a different execution host can execute binaries compiled elsewhere.
0 commit comments