@@ -134,17 +134,17 @@ jobs:
134
134
135
135
env :
136
136
CCACHE_MAXSIZE : ' 200M'
137
- CI_CCACHE_VERSION : ' 4.7.5'
138
- 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'
139
- CI_QT_DIR : ' qt-everywhere-src-5.15.11'
140
- CI_QT_URL : ' https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
141
137
PYTHONUTF8 : 1
142
138
TEST_RUNNER_TIMEOUT_FACTOR : 40
143
139
144
140
steps :
145
141
- name : Checkout
146
142
uses : actions/checkout@v4
147
143
144
+ - name : Remove non-MSVC tool installations
145
+ run : |
146
+ Remove-Item -Path "$env:ProgramFiles/CMake" -Recurse -Force
147
+
148
148
- name : Configure Developer Command Prompt for Microsoft Visual C++
149
149
# Using microsoft/setup-msbuild is not enough.
150
150
uses : ilammy/msvc-dev-cmd@v1
@@ -153,122 +153,67 @@ jobs:
153
153
154
154
- name : Get tool information
155
155
run : |
156
+ cmake --version | Out-File -FilePath "cmake_version"
157
+ Get-Content -Path "cmake_version"
158
+ Write-Output "---"
156
159
msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version"
157
160
Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version"
158
161
$env:VCToolsVersion | Out-File -FilePath "$env:GITHUB_WORKSPACE\toolset_version"
159
162
Write-Host "VCToolsVersion $(Get-Content -Path "$env:GITHUB_WORKSPACE\toolset_version")"
160
- $env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url"
161
- $env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf"
162
163
py -3 --version
163
164
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
164
165
165
- - name : Restore static Qt cache
166
- id : static-qt-cache
167
- uses : actions/cache/restore@v4
168
- with :
169
- path : C:\Qt_static
170
- key : ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
171
-
172
- - name : Build static Qt. Download
173
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
174
- shell : cmd
175
- run : |
176
- curl --location --output C:\qt-src.zip %CI_QT_URL%
177
- choco install --yes --no-progress jom
178
-
179
- - name : Build static Qt. Expand source archive
180
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
181
- shell : cmd
182
- run : tar -xf C:\qt-src.zip -C C:\
183
-
184
- - name : Build static Qt. Create build directory
185
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
186
- run : |
187
- Rename-Item -Path "C:\$env:CI_QT_DIR" -NewName "C:\qt-src"
188
- New-Item -ItemType Directory -Path "C:\qt-src\build"
189
-
190
- - name : Build static Qt. Configure
191
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
192
- working-directory : C:\qt-src\build
193
- shell : cmd
194
- run : ..\configure %CI_QT_CONF% -prefix C:\Qt_static
195
-
196
- - name : Build static Qt. Build
197
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
198
- working-directory : C:\qt-src\build
199
- shell : cmd
200
- run : jom
201
-
202
- - name : Build static Qt. Install
203
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
204
- working-directory : C:\qt-src\build
205
- shell : cmd
206
- run : jom install
207
-
208
- - name : Save static Qt cache
209
- if : steps.static-qt-cache.outputs.cache-hit != 'true'
210
- uses : actions/cache/save@v4
211
- with :
212
- path : C:\Qt_static
213
- key : ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
214
-
215
- - name : Ccache installation cache
216
- id : ccache-installation-cache
217
- uses : actions/cache@v4
218
- with :
219
- path : |
220
- C:\ProgramData\chocolatey\lib\ccache
221
- C:\ProgramData\chocolatey\bin\ccache.exe
222
- C:\ccache\cl.exe
223
- key : ${{ github.job }}-ccache-installation-${{ env.CI_CCACHE_VERSION }}
224
-
225
166
- name : Install Ccache
226
- if : steps.ccache-installation-cache.outputs.cache-hit != 'true'
227
167
run : |
228
- choco install --yes --no-progress ccache --version=$env:CI_CCACHE_VERSION
229
- New-Item -ItemType Directory -Path "C:\ccache"
230
- Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"
231
-
232
- - name : Restore Ccache cache
233
- id : ccache-cache
234
- uses : actions/cache/restore@v4
235
- with :
236
- path : ~/AppData/Local/ccache
237
- key : ${{ github.job }}-ccache-${{ github.run_id }}
238
- restore-keys : ${{ github.job }}-ccache-
168
+ choco install --yes --no-progress ccache
239
169
240
170
- name : Using vcpkg with MSBuild
241
171
run : |
242
172
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
243
- Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
244
- Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
245
- .\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
246
- git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
247
- Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
173
+ Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
174
+ Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
248
175
249
176
- name : vcpkg tools cache
250
177
uses : actions/cache@v4
251
178
with :
252
179
path : C:/vcpkg/downloads/tools
253
180
key : ${{ github.job }}-vcpkg-tools
254
181
255
- - name : vcpkg binary cache
256
- uses : actions/cache@v4
182
+ - name : Restore vcpkg binary cache
183
+ uses : actions/cache/restore@v4
184
+ id : vcpkg-binary-cache
257
185
with :
258
186
path : ~/AppData/Local/vcpkg/archives
259
- key : ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'toolset_version', 'build_msvc/vcpkg.json') }}
187
+ key : ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
188
+
189
+ - name : Generate build system
190
+ run : |
191
+ cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DWERROR=ON
260
192
261
- - name : Generate project files
262
- run : py -3 build_msvc\msvc-autogen.py
193
+ - name : Save vcpkg binary cache
194
+ uses : actions/cache/save@v4
195
+ if : github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true'
196
+ with :
197
+ path : ~/AppData/Local/vcpkg/archives
198
+ key : ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
199
+
200
+ - name : Restore Ccache cache
201
+ id : ccache-cache
202
+ uses : actions/cache/restore@v4
203
+ with :
204
+ path : ~/AppData/Local/ccache
205
+ key : ${{ github.job }}-ccache-
263
206
264
207
- name : Build
265
- shell : cmd
208
+ working-directory : build
266
209
run : |
267
210
ccache --zero-stats
268
- msbuild build_msvc\bitcoin.sln -property:CLToolPath=C:\ccache;CLToolExe=cl.exe;UseMultiToolTask=true;Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
211
+ cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release
269
212
270
213
- name : Ccache stats
271
- run : ccache --show-stats
214
+ run : |
215
+ ccache --version | head -n 1
216
+ ccache --show-stats --verbose
272
217
273
218
- name : Save Ccache cache
274
219
uses : actions/cache/save@v4
@@ -278,20 +223,18 @@ jobs:
278
223
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
279
224
key : ${{ github.job }}-ccache-${{ github.run_id }}
280
225
281
- - name : Run unit tests
282
- run : src\test_bitcoin.exe -l test_suite
283
-
284
- - name : Run benchmarks
285
- run : src\bench_bitcoin.exe -sanity-check
286
-
287
- - name : Run util tests
288
- run : py -3 test\util\test_runner.py
289
-
290
- - name : Run rpcauth test
291
- run : py -3 test\util\rpcauth-test.py
226
+ - name : Run test suite
227
+ working-directory : build
228
+ run : |
229
+ ctest -j $env:NUMBER_OF_PROCESSORS -C Release
292
230
293
231
- name : Run functional tests
232
+ working-directory : build
294
233
env :
234
+ BITCOIND : ' ${{ github.workspace }}\build\src\Release\bitcoind.exe'
235
+ BITCOINCLI : ' ${{ github.workspace }}\build\src\Release\bitcoin-cli.exe'
236
+ BITCOINUTIL : ' ${{ github.workspace }}\build\src\Release\bitcoin-util.exe'
237
+ BITCOINWALLET : ' ${{ github.workspace }}\build\src\Release\bitcoin-wallet.exe'
295
238
TEST_RUNNER_EXTRA : ${{ github.event_name != 'pull_request' && '--extended' || '' }}
296
239
shell : cmd
297
240
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%
0 commit comments