Skip to content

Commit

Permalink
Merge bitcoin#21551: ci: Move Windows MSVC build from AppVeyor to Cirrus
Browse files Browse the repository at this point in the history
97292b1 ci: Drop AppVeyor CI integration (Hennadii Stepanov)
1fb7079 ci: Add Windows task to Cirrus CI (Hennadii Stepanov)

Pull request description:

  This PR:
  - gets rid off unreliable AppVeyor CI
  - places all CI configs in one place
  - allows to enable functional tests in the future (using a persistent worker)

  | no populated `vcpkg` cache | populated `vcpkg` cache |
  |---|---|
  | ![Screenshot from 2021-09-02 15-47-04](https://user-images.githubusercontent.com/32963518/131846156-9367bffc-9093-40ca-98c3-15db74e24113.png) | ![Screenshot from 2021-09-02 14-06-26](https://user-images.githubusercontent.com/32963518/131833053-a501454d-eecf-463c-a3a4-b89d2a494058.png) |

  Currently, AppVeyor builds take about 44..48 minutes.

ACKs for top commit:
  sipsorcery:
    re-ACK 97292b1.

Tree-SHA512: 3af50d9fd68eb12f39724810dacf948e4068573b5dfd0dbaeb05d19d4bd6f10bd9a432656dcc32b742684b438d31305eace85c602296d7a1bf84b2f1fcc06f02
  • Loading branch information
MarcoFalke authored and knst committed Feb 22, 2025
1 parent 843a00d commit f437964
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 4 deletions.
75 changes: 72 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ env:
CCACHE_DIR: "/tmp/ccache_dir"

# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
base_template: &BASE_TEMPLATE
filter_template: &FILTER_TEMPLATE
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks

base_template: &BASE_TEMPLATE
<< : *FILTER_TEMPLATE
merge_base_script:
# Unconditionally install git (used in fingerprint_script) and set the
# default git author name (used in verify-commits.py)
Expand All @@ -21,7 +25,6 @@ base_template: &BASE_TEMPLATE
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks

global_task_template: &GLOBAL_TASK_TEMPLATE
<< : *BASE_TEMPLATE
Expand All @@ -47,7 +50,6 @@ compute_credits_template: &CREDITS_TEMPLATE
# Only use credits for pull requests to the main repo
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'dashpay/dash' && $CIRRUS_PR != ""


task:
name: 'lint [bookworm]'
<< : *BASE_TEMPLATE
Expand All @@ -63,6 +65,73 @@ task:
lint_script:
- ./ci/lint_run_all.sh

task:
name: "Win64 native [unit tests, no functional tests] [msvc]"
<< : *FILTER_TEMPLATE
windows_container:
cpu: 4
memory: 16G
image: cirrusci/windowsservercore:visualstudio2019
timeout_in: 120m
env:
CIRRUS_SHELL: powershell
PATH: 'C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin;%PATH%'
PYTHONUTF8: 1
VCPKG_TAG: '75522bb1f2e7d863078bcd06322348f053a9e33f'
VCPKG_FEATURE_FLAGS: 'manifests'
QT_DOWNLOAD_URL: 'https://github.com/sipsorcery/qt_win_binary/releases/download/qt51211x64_static_vs2019_160900/Qt5.12.11_x64_static_vs2019_160900.zip'
QT_DOWNLOAD_HASH: 'b24436bbc49ac69d992efc148e640f02e8dec426bed5f8497abf735e7d7d59d0'
QT_LOCAL_PATH: 'C:\Qt5.12.11_x64_static_vs2019_160900'
IgnoreWarnIntDirInTempDetected: 'true'
merge_script:
- git config --global user.email "ci@ci.ci"
- git config --global user.name "ci"
- git config core.filemode false
- git reset --hard
- if ($env:CIRRUS_PR -eq $null) { exit 0; }
- git fetch $env:CIRRUS_REPO_CLONE_URL $env:CIRRUS_BASE_BRANCH
- git merge FETCH_HEAD
vcpkg_cache:
folder: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives'
install_python_script:
- choco install --yes --no-progress python3 --version=3.9.6
- Write-Host ""
- python -VV
install_vcpkg_script:
- cd ..
- git clone --quiet https://github.com/microsoft/vcpkg.git
- cd vcpkg
- git -c advice.detachedHead=false checkout $env:VCPKG_TAG
- .\bootstrap-vcpkg -disableMetrics
- Add-Content "triplets\x64-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
- .\vcpkg integrate install
- Write-Host ""
- .\vcpkg version
download_qt_binaries_script: |
Invoke-WebRequest -Uri $env:QT_DOWNLOAD_URL -Out qtdownload.zip;
Write-Host "Qt binaries successfully downloaded, checking hash against $env:QT_DOWNLOAD_HASH...";
if ((Get-FileHash qtdownload.zip).Hash -eq $env:QT_DOWNLOAD_HASH) {
Write-Host "Downloaded Qt binaries archive matched the expected hash.";
Expand-Archive qtdownload.zip -DestinationPath $env:QT_LOCAL_PATH;
}
else {
Write-Host "ERROR: Downloaded Qt binaries archive did not match the expected hash.";
exit 1;
}
build_environment_script:
- choco list --localonly
- Write-Host ""
- msbuild -version
build_script:
- cd $env:CIRRUS_WORKING_DIR
- python build_msvc\msvc-autogen.py
- msbuild build_msvc\bitcoin.sln -property:Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
unit_tests_script:
- src\test_bitcoin.exe
- src\bench_bitcoin.exe > $null
- python test\util\test_runner.py
- python test\util\rpcauth-test.py

task:
name: 'ARM [unit tests, no functional tests] [buster]'
<< : *GLOBAL_TASK_TEMPLATE
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trim_trailing_whitespace = true
[*.{h,cpp,py,sh}]
indent_size = 4

# .cirrus.yml, .appveyor.yml, .fuzzbuzz.yml, etc.
# .cirrus.yml, .fuzzbuzz.yml, etc.
[*.yml]
indent_size = 2

Expand Down

0 comments on commit f437964

Please sign in to comment.