From f437964457d0db9b19d32072ddb0f187c1618ea4 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 7 Sep 2021 11:20:23 +0200 Subject: [PATCH] Merge bitcoin/bitcoin#21551: ci: Move Windows MSVC build from AppVeyor to Cirrus 97292b19140db32c6d85d63b70382e7bf60a55c4 ci: Drop AppVeyor CI integration (Hennadii Stepanov) 1fb70793b237b9a3a00ff744739e512dd7755937 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 97292b19140db32c6d85d63b70382e7bf60a55c4. Tree-SHA512: 3af50d9fd68eb12f39724810dacf948e4068573b5dfd0dbaeb05d19d4bd6f10bd9a432656dcc32b742684b438d31305eace85c602296d7a1bf84b2f1fcc06f02 --- .cirrus.yml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--- .editorconfig | 2 +- 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 2f2474302fb24..a8b1c3c46d1e3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/.editorconfig b/.editorconfig index 4967e675f642f..ae7e92d1c8a82 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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