Skip to content

Commit 6a43372

Browse files
committed
ci: Run "Win64 native" job on GitHub Actions
1 parent c9273f6 commit 6a43372

File tree

3 files changed

+196
-97
lines changed

3 files changed

+196
-97
lines changed

.cirrus.yml

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -101,102 +101,6 @@ task:
101101
env:
102102
FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh"
103103

104-
task:
105-
name: "Win64 native [vs2022]"
106-
<< : *FILTER_TEMPLATE
107-
windows_container:
108-
cpu: 6
109-
memory: 12G
110-
image: cirrusci/windowsservercore:visualstudio2022
111-
timeout_in: 120m
112-
env:
113-
PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;%PATH%'
114-
PYTHONUTF8: 1
115-
CI_VCPKG_TAG: '2023.01.09'
116-
VCPKG_DOWNLOADS: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\downloads'
117-
VCPKG_DEFAULT_BINARY_CACHE: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives'
118-
CCACHE_DIR: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
119-
WRAPPED_CL: 'C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\ci\test\wrapped-cl.bat'
120-
QT_DOWNLOAD_URL: 'https://download.qt.io/official_releases/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.zip'
121-
QT_LOCAL_PATH: 'C:\qt-everywhere-opensource-src-5.15.5.zip'
122-
QT_SOURCE_DIR: 'C:\qt-everywhere-src-5.15.5'
123-
QTBASEDIR: 'C:\Qt_static'
124-
x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
125-
QT_CONFIGURE_COMMAND: '..\configure -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'
126-
IgnoreWarnIntDirInTempDetected: 'true'
127-
merge_script:
128-
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; }
129-
msvc_qt_built_cache:
130-
folder: "%QTBASEDIR%"
131-
reupload_on_changes: false
132-
fingerprint_script:
133-
- echo %QT_DOWNLOAD_URL% %QT_CONFIGURE_COMMAND%
134-
- msbuild -version
135-
populate_script:
136-
- curl -L -o C:\jom.zip http://download.qt.io/official_releases/jom/jom.zip
137-
- mkdir C:\jom
138-
- tar -xf C:\jom.zip -C C:\jom
139-
- curl -L -o %QT_LOCAL_PATH% %QT_DOWNLOAD_URL%
140-
- tar -xf %QT_LOCAL_PATH% -C C:\
141-
- '%x64_NATIVE_TOOLS%'
142-
- cd %QT_SOURCE_DIR%
143-
- mkdir build
144-
- cd build
145-
- '%QT_CONFIGURE_COMMAND% -prefix %QTBASEDIR%'
146-
- jom
147-
- jom install
148-
vcpkg_tools_cache:
149-
folder: '%VCPKG_DOWNLOADS%\tools'
150-
reupload_on_changes: false
151-
fingerprint_script:
152-
- echo %CI_VCPKG_TAG%
153-
- msbuild -version
154-
vcpkg_binary_cache:
155-
folder: '%VCPKG_DEFAULT_BINARY_CACHE%'
156-
reupload_on_changes: true
157-
fingerprint_script:
158-
- echo %CI_VCPKG_TAG%
159-
- type build_msvc\vcpkg.json
160-
- msbuild -version
161-
populate_script:
162-
- mkdir %VCPKG_DEFAULT_BINARY_CACHE%
163-
ccache_cache:
164-
folder: '%CCACHE_DIR%'
165-
install_tools_script:
166-
- choco install --yes --no-progress ccache --version=4.7.4
167-
- choco install --yes --no-progress python3 --version=3.9.6
168-
- pip install zmq
169-
- ccache --version
170-
- python -VV
171-
install_vcpkg_script:
172-
- cd ..
173-
- git clone --quiet https://github.com/microsoft/vcpkg.git
174-
- cd vcpkg
175-
- git -c advice.detachedHead=false checkout %CI_VCPKG_TAG%
176-
- .\bootstrap-vcpkg -disableMetrics
177-
- echo set(VCPKG_BUILD_TYPE release) >> triplets\x64-windows-static.cmake
178-
- .\vcpkg integrate install
179-
- .\vcpkg version
180-
build_script:
181-
- '%x64_NATIVE_TOOLS%'
182-
- cd %CIRRUS_WORKING_DIR%
183-
- ccache --zero-stats
184-
- python build_msvc\msvc-autogen.py
185-
- msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL%;UseMultiToolTask=true;Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
186-
- ccache --show-stats
187-
check_script:
188-
- src\test_bitcoin.exe -l test_suite
189-
- src\bench_bitcoin.exe --sanity-check
190-
- python test\util\test_runner.py
191-
- python test\util\rpcauth-test.py
192-
functional_tests_script:
193-
# Increase the dynamic port range to the maximum allowed value to mitigate "OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted".
194-
# See: https://learn.microsoft.com/en-us/biztalk/technical-guides/settings-that-can-be-modified-to-improve-network-performance
195-
- netsh int ipv4 set dynamicport tcp start=1025 num=64511
196-
- netsh int ipv6 set dynamicport tcp start=1025 num=64511
197-
# Exclude feature_dbcrash for now due to timeout
198-
- python test\functional\test_runner.py --nocleanup --ci --quiet --combinedlogslen=99999999 --jobs=6 --timeout-factor=8 --extended --exclude feature_dbcrash
199-
200104
task:
201105
name: 'ARM, unit tests, no functional tests'
202106
<< : *GLOBAL_TASK_TEMPLATE

.github/workflows/ci.yml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,199 @@ jobs:
6868
path: ${{ env.CCACHE_DIR }}
6969
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
7070
key: ${{ github.job }}-ccache-${{ github.run_id }}
71+
72+
win64-native:
73+
name: 'Win64 native, VS 2022'
74+
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
75+
# See: https://github.com/actions/runner-images#available-images.
76+
runs-on: windows-2022
77+
78+
# No need to run on the read-only mirror, unless it is a PR.
79+
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
80+
81+
env:
82+
CCACHE_MAXSIZE: '200M'
83+
CI_CCACHE_VERSION: '4.7.5'
84+
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'
85+
CI_QT_DIR: 'qt-everywhere-src-5.15.5'
86+
CI_QT_URL: 'https://download.qt.io/official_releases/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.zip'
87+
PYTHONUTF8: 1
88+
TEST_RUNNER_TIMEOUT_FACTOR: 40
89+
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v3
93+
94+
- name: Fix Visual Studio installation
95+
# See: https://github.com/actions/runner-images/issues/7832#issuecomment-1617585694.
96+
run: |
97+
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
98+
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
99+
$componentsToRemove= @(
100+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM"
101+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM.Spectre"
102+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64"
103+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64.Spectre"
104+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64"
105+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64.Spectre"
106+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL"
107+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.Spectre"
108+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM"
109+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM.Spectre"
110+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64"
111+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64.Spectre"
112+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC"
113+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.Spectre"
114+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM"
115+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM.Spectre"
116+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64"
117+
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64.Spectre"
118+
)
119+
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_}
120+
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
121+
# should be run twice
122+
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
123+
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
124+
125+
- name: Configure Developer Command Prompt for Microsoft Visual C++
126+
# Using microsoft/setup-msbuild is not enough.
127+
uses: ilammy/msvc-dev-cmd@v1
128+
with:
129+
arch: x64
130+
131+
- name: Check MSBuild and Qt
132+
run: |
133+
msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version"
134+
Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version"
135+
$env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url"
136+
$env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf"
137+
138+
- name: Restore static Qt cache
139+
id: static-qt-cache
140+
uses: actions/cache/restore@v3
141+
with:
142+
path: C:\Qt_static
143+
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
144+
145+
- name: Build static Qt. Download
146+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
147+
shell: cmd
148+
run: |
149+
curl --location --output C:\qt-src.zip %CI_QT_URL%
150+
choco install --yes --no-progress jom
151+
152+
- name: Build static Qt. Expand source archive
153+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
154+
shell: cmd
155+
run: tar -xf C:\qt-src.zip -C C:\
156+
157+
- name: Build static Qt. Create build directory
158+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
159+
run: |
160+
Rename-Item -Path "C:\$env:CI_QT_DIR" -NewName "C:\qt-src"
161+
New-Item -ItemType Directory -Path "C:\qt-src\build"
162+
163+
- name: Build static Qt. Configure
164+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
165+
working-directory: C:\qt-src\build
166+
shell: cmd
167+
run: ..\configure %CI_QT_CONF% -prefix C:\Qt_static
168+
169+
- name: Build static Qt. Build
170+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
171+
working-directory: C:\qt-src\build
172+
shell: cmd
173+
run: jom
174+
175+
- name: Build static Qt. Install
176+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
177+
working-directory: C:\qt-src\build
178+
shell: cmd
179+
run: jom install
180+
181+
- name: Save static Qt cache
182+
if: steps.static-qt-cache.outputs.cache-hit != 'true'
183+
uses: actions/cache/save@v3
184+
with:
185+
path: C:\Qt_static
186+
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
187+
188+
- name: Ccache installation cache
189+
id: ccache-installation-cache
190+
uses: actions/cache@v3
191+
with:
192+
path: |
193+
C:\ProgramData\chocolatey\lib\ccache
194+
C:\ProgramData\chocolatey\bin\ccache.exe
195+
C:\ccache\cl.exe
196+
key: ${{ github.job }}-ccache-installation-${{ env.CI_CCACHE_VERSION }}
197+
198+
- name: Install Ccache
199+
if: steps.ccache-installation-cache.outputs.cache-hit != 'true'
200+
run: |
201+
choco install --yes --no-progress ccache --version=$env:CI_CCACHE_VERSION
202+
New-Item -ItemType Directory -Path "C:\ccache"
203+
Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"
204+
205+
- name: Restore Ccache cache
206+
uses: actions/cache/restore@v3
207+
with:
208+
path: ~/AppData/Local/ccache
209+
key: ${{ github.job }}-ccache-${{ github.run_id }}
210+
restore-keys: ${{ github.job }}-ccache-
211+
212+
- name: Using vcpkg with MSBuild
213+
run: |
214+
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
215+
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
216+
vcpkg --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
217+
git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
218+
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
219+
220+
- name: vcpkg tools cache
221+
uses: actions/cache@v3
222+
with:
223+
path: C:/vcpkg/downloads/tools
224+
key: ${{ github.job }}-vcpkg-tools
225+
226+
- name: vcpkg binary cache
227+
uses: actions/cache@v3
228+
with:
229+
path: ~/AppData/Local/vcpkg/archives
230+
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'build_msvc/vcpkg.json') }}
231+
232+
- name: Generate project files
233+
run: py -3 build_msvc\msvc-autogen.py
234+
235+
- name: Build
236+
shell: cmd
237+
run: |
238+
ccache --zero-stats
239+
msbuild build_msvc\bitcoin.sln -property:CLToolPath=C:\ccache;CLToolExe=cl.exe;UseMultiToolTask=true;Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
240+
241+
- name: Ccache stats
242+
run: ccache --show-stats
243+
244+
- name: Save Ccache cache
245+
uses: actions/cache/save@v3
246+
if: github.event_name != 'pull_request'
247+
with:
248+
path: ~/AppData/Local/ccache
249+
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
250+
key: ${{ github.job }}-ccache-${{ github.run_id }}
251+
252+
- name: Run unit tests
253+
run: src\test_bitcoin.exe -l test_suite
254+
255+
- name: Run benchmarks
256+
run: src\bench_bitcoin.exe -sanity-check
257+
258+
- name: Run util tests
259+
run: py -3 test\util\test_runner.py
260+
261+
- name: Run rpcauth test
262+
run: py -3 test\util\rpcauth-test.py
263+
264+
- name: Run functional tests
265+
shell: cmd
266+
run: py -3 test\functional\test_runner.py --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% --extended --exclude feature_dbcrash

ci/test/wrapped-cl.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)