@@ -67,12 +67,12 @@ jobs:
67
67
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
68
68
- run : |
69
69
sudo apt-get update
70
- sudo apt-get install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
70
+ sudo apt-get install clang ccache build-essential cmake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
71
71
- name : Compile and run tests
72
72
run : |
73
73
# Run tests on commits after the last merge commit and before the PR head commit
74
74
# Use clang++, because it is a bit faster and uses less memory than g++
75
- git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang CXX=clang++ ./configure --with-incompatible-bdb && make clean && make - j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
75
+ git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_NATPMP=ON -DWITH_MINIUPNPC=ON -DWITH_USDT=ON && cmake --build build -j $(nproc) && ctest --test-dir build - j $(nproc) && ./build /test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
76
76
77
77
macos-native-x86_64 :
78
78
name : ' macOS 13 native, x86_64, no depends, sqlite only, gui'
@@ -139,18 +139,17 @@ jobs:
139
139
if : github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
140
140
141
141
env :
142
- CCACHE_MAXSIZE : ' 200M'
143
- CI_CCACHE_VERSION : ' 4.7.5'
144
- CI_QT_CONF: '-release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml'
145
- CI_QT_DIR : ' qt-everywhere-src-5.15.11'
146
- CI_QT_URL : ' https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
147
142
PYTHONUTF8 : 1
148
143
TEST_RUNNER_TIMEOUT_FACTOR : 40
149
144
150
145
steps :
151
146
- name : Checkout
152
147
uses : actions/checkout@v4
153
148
149
+ - name : Remove non-MSVC tool installations
150
+ run : |
151
+ Remove-Item -Path "$env:ProgramFiles/CMake" -Recurse -Force
152
+
154
153
- name : Configure Developer Command Prompt for Microsoft Visual C++
155
154
# Using microsoft/setup-msbuild is not enough.
156
155
uses : ilammy/msvc-dev-cmd@v1
@@ -159,141 +158,60 @@ jobs:
159
158
160
159
- name : Get tool information
161
160
run : |
161
+ cmake -version | Tee-Object -FilePath "cmake_version"
162
+ Write-Output "---"
162
163
msbuild -version | Tee-Object -FilePath "msbuild_version"
163
164
$env:VCToolsVersion | Tee-Object -FilePath "toolset_version"
164
- $env:CI_QT_URL | Out-File -FilePath "qt_url"
165
- $env:CI_QT_CONF | Out-File -FilePath "qt_conf"
166
165
py -3 --version
167
166
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
168
167
169
- - name : Restore static Qt cache
170
- id : static-qt-cache
171
- uses : actions/cache/restore@v4
172
- with :
173
- path : C:\Qt_static
174
- key : ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
175
-
176
- - name : Build static Qt. Download
177
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
178
- shell : cmd
179
- run : |
180
- curl --location --output C:\qt-src.zip %CI_QT_URL%
181
- choco install --yes --no-progress jom
182
-
183
- - name : Build static Qt. Expand source archive
184
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
185
- shell : cmd
186
- run : tar -xf C:\qt-src.zip -C C:\
187
-
188
- - name : Build static Qt. Create build directory
189
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
190
- run : |
191
- Rename-Item -Path "C:\$env:CI_QT_DIR" -NewName "C:\qt-src"
192
- New-Item -ItemType Directory -Path "C:\qt-src\build"
193
-
194
- - name : Build static Qt. Configure
195
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
196
- working-directory : C:\qt-src\build
197
- shell : cmd
198
- run : ..\configure %CI_QT_CONF% -prefix C:\Qt_static
199
-
200
- - name : Build static Qt. Build
201
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
202
- working-directory : C:\qt-src\build
203
- shell : cmd
204
- run : jom
205
-
206
- - name : Build static Qt. Install
207
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
208
- working-directory : C:\qt-src\build
209
- shell : cmd
210
- run : jom install
211
-
212
- - name : Save static Qt cache
213
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
214
- uses : actions/cache/save@v4
215
- with :
216
- path : C:\Qt_static
217
- key : ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
218
-
219
- - name : Ccache installation cache
220
- id : ccache-installation-cache
221
- uses : actions/cache@v4
222
- with :
223
- path : |
224
- C:\ProgramData\chocolatey\lib\ccache
225
- C:\ProgramData\chocolatey\bin\ccache.exe
226
- C:\ccache\cl.exe
227
- key : ${{ github.job }}-ccache-installation-${{ env.CI_CCACHE_VERSION }}
228
-
229
- - name : Install Ccache
230
- if : steps.ccache-installation-cache.outputs.cache-hit != 'true'
231
- run : |
232
- choco install --yes --no-progress ccache --version=$env:CI_CCACHE_VERSION
233
- New-Item -ItemType Directory -Path "C:\ccache"
234
- Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"
235
-
236
- - name : Restore Ccache cache
237
- id : ccache-cache
238
- uses : actions/cache/restore@v4
239
- with :
240
- path : ~/AppData/Local/ccache
241
- key : ${{ github.job }}-ccache-${{ github.run_id }}
242
- restore-keys : ${{ github.job }}-ccache-
243
-
244
168
- name : Using vcpkg with MSBuild
245
169
run : |
246
170
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
171
+ Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
247
172
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
248
- .\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
249
- git rev-parse HEAD | Tee-Object -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
250
173
251
174
- name : vcpkg tools cache
252
175
uses : actions/cache@v4
253
176
with :
254
177
path : C:/vcpkg/downloads/tools
255
178
key : ${{ github.job }}-vcpkg-tools
256
179
257
- - name : vcpkg binary cache
258
- uses : actions/cache@v4
180
+ - name : Restore vcpkg binary cache
181
+ uses : actions/cache/restore@v4
182
+ id : vcpkg-binary-cache
259
183
with :
260
184
path : ~/AppData/Local/vcpkg/archives
261
- key : ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'toolset_version', 'build_msvc/vcpkg.json') }}
262
-
263
- - name : Generate project files
264
- run : py -3 build_msvc\msvc-autogen.py
185
+ key : ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
265
186
266
- - name : Build
267
- shell : cmd
187
+ - name : Generate build system
268
188
run : |
269
- ccache --zero-stats
270
- msbuild build_msvc\bitcoin.sln -property:CLToolPath=C:\ccache;CLToolExe=cl.exe;UseMultiToolTask=true;Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
271
-
272
- - name : Ccache stats
273
- run : ccache --show-stats
189
+ cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
274
190
275
- - name : Save Ccache cache
191
+ - name : Save vcpkg binary cache
276
192
uses : actions/cache/save@v4
277
- if : github.event_name != 'pull_request' && steps.ccache -cache.outputs.cache-hit != 'true'
193
+ if : github.event_name != 'pull_request' && steps.vcpkg-binary -cache.outputs.cache-hit != 'true'
278
194
with :
279
- path : ~/AppData/Local/ccache
280
- # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
281
- key : ${{ github.job }}-ccache-${{ github.run_id }}
282
-
283
- - name : Run unit tests
284
- run : src\test_bitcoin.exe -l test_suite
285
-
286
- - name : Run benchmarks
287
- run : src\bench_bitcoin.exe -sanity-check
195
+ path : ~/AppData/Local/vcpkg/archives
196
+ key : ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
288
197
289
- - name : Run util tests
290
- run : py -3 test\util\test_runner.py
198
+ - name : Build
199
+ working-directory : build
200
+ run : |
201
+ cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release
291
202
292
- - name : Run rpcauth test
293
- run : py -3 test\util\rpcauth-test.py
203
+ - name : Run test suite
204
+ working-directory : build
205
+ run : |
206
+ ctest -j $env:NUMBER_OF_PROCESSORS -C Release
294
207
295
208
- name : Run functional tests
209
+ working-directory : build
296
210
env :
211
+ BITCOIND : ' ${{ github.workspace }}\build\src\Release\bitcoind.exe'
212
+ BITCOINCLI : ' ${{ github.workspace }}\build\src\Release\bitcoin-cli.exe'
213
+ BITCOINUTIL : ' ${{ github.workspace }}\build\src\Release\bitcoin-util.exe'
214
+ BITCOINWALLET : ' ${{ github.workspace }}\build\src\Release\bitcoin-wallet.exe'
297
215
TEST_RUNNER_EXTRA : ${{ github.event_name != 'pull_request' && '--extended' || '' }}
298
216
shell : cmd
299
217
run : py -3 test\functional\test_runner.py --jobs %NUMBER_OF_PROCESSORS% --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% %TEST_RUNNER_EXTRA%
@@ -306,8 +224,9 @@ jobs:
306
224
git log -1
307
225
308
226
- name : Run fuzz binaries
227
+ working-directory : build
309
228
env :
310
- BITCOINFUZZ : " ${{ github.workspace}}\\ src\\ fuzz.exe"
229
+ BITCOINFUZZ : ' ${{ github.workspace }}\build \src\test \fuzz\Release\fuzz .exe'
311
230
shell : cmd
312
231
run : py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_seed_corpus
313
232
0 commit comments