[DEBUG] ci: Minimize it #3499
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2023 The Bitcoin Core developers | |
# Distributed under the MIT software license, see the accompanying | |
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
name: CI | |
on: | |
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request. | |
pull_request: | |
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push. | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
concurrency: | |
group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }} | |
cancel-in-progress: true | |
env: | |
CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error | |
MAKEJOBS: '-j10' | |
jobs: | |
win64-native: | |
name: 'Win64 native, VS 2022' | |
# Use latest image, but hardcode version to avoid silent upgrades (and breaks). | |
# See: https://github.com/actions/runner-images#available-images. | |
runs-on: windows-2022 | |
# No need to run on the read-only mirror, unless it is a PR. | |
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request' | |
env: | |
PYTHONUTF8: 1 | |
TEST_RUNNER_TIMEOUT_FACTOR: 40 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure Developer Command Prompt for Microsoft Visual C++ | |
# Using microsoft/setup-msbuild is not enough. | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: Get tool information | |
run: | | |
cmake -version | Tee-Object -FilePath "cmake_version" | |
Write-Output "---" | |
msbuild -version | Tee-Object -FilePath "msbuild_version" | |
$env:VCToolsVersion | Tee-Object -FilePath "toolset_version" | |
py -3 --version | |
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())" | |
- name: Using vcpkg with MSBuild | |
run: | | |
Set-Location "$env:VCPKG_INSTALLATION_ROOT" | |
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)" | |
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)" | |
- name: vcpkg tools cache | |
uses: actions/cache@v4 | |
with: | |
path: C:/vcpkg/downloads/tools | |
key: ${{ github.job }}-vcpkg-tools | |
- name: Restore vcpkg binary cache | |
uses: actions/cache/restore@v4 | |
id: vcpkg-binary-cache | |
with: | |
path: ~/AppData/Local/vcpkg/archives | |
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }} | |
- name: Available vcpkg baseline | |
# While the vcpkg.json file includes packages with pinned versions, | |
# we need to maintain its "builtin-baseline" field. | |
run: | | |
vcpkg x-update-baseline --dry-run |