Windows prepare
This commit is contained in:
parent
969c34ea4a
commit
6280a95b27
4 changed files with 56 additions and 5 deletions
7
.github/workflows/unit_tests.yml
vendored
7
.github/workflows/unit_tests.yml
vendored
|
@ -156,11 +156,8 @@ jobs:
|
|||
path: build
|
||||
key: ${{ runner.os }}-build-cache
|
||||
|
||||
- name: Windows Defender
|
||||
run: ci/actions/windows/disable_windows_defender.ps1
|
||||
|
||||
- name: Fetch Deps
|
||||
run: ci/actions/windows/install_deps.ps1
|
||||
- name: Prepare
|
||||
run: ci/prepare/windows/prepare.ps1
|
||||
|
||||
- name: Build Tests
|
||||
run: ci/actions/windows/build.ps1
|
||||
|
|
5
ci/prepare/windows/disable-defender.ps1
Normal file
5
ci/prepare/windows/disable-defender.ps1
Normal file
|
@ -0,0 +1,5 @@
|
|||
$ErrorActionPreference = "Continue"
|
||||
|
||||
Set-MpPreference -DisableArchiveScanning $true
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
Set-MpPreference -DisableBehaviorMonitoring $true
|
45
ci/prepare/windows/install-qt.ps1
Normal file
45
ci/prepare/windows/install-qt.ps1
Normal file
|
@ -0,0 +1,45 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Download and extract Qt library.
|
||||
# Original files can be found at: https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/
|
||||
|
||||
# Define URLs, file names and their corresponding SHA1 hashes
|
||||
$toDownload = @(
|
||||
@{
|
||||
Url = 'https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/5.15.2-0-202011130602qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z';
|
||||
FileName = 'qt5base.7z';
|
||||
SHA1 = 'e29464430a2225bce6ce96b4ed18eec3f8b944d6';
|
||||
},
|
||||
@{
|
||||
Url = 'https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/5.15.2-0-202011130602qtwinextras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z';
|
||||
FileName = 'qt5winextra.7z';
|
||||
SHA1 = '70da33b18ddeac4dd00ceed205f8110c426cea16';
|
||||
}
|
||||
)
|
||||
|
||||
$targetFolder = "C:\Qt"
|
||||
|
||||
# Download and process files
|
||||
foreach ($entry in $toDownload) {
|
||||
$tempFile = Join-Path $env:TEMP $entry.FileName
|
||||
|
||||
# Download file
|
||||
Invoke-WebRequest -Uri $entry.Url -OutFile $tempFile
|
||||
|
||||
# Calculate file hash
|
||||
$fileHash = (Get-FileHash -Path $tempFile -Algorithm SHA1).Hash
|
||||
|
||||
# Compare hashes
|
||||
if ($fileHash -eq $entry.SHA1) {
|
||||
Write-Host "Hashes match for $($entry.FileName)."
|
||||
} else {
|
||||
Write-Error "Hashes do not match for $($entry.FileName). Stopping script execution."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Decompress archive
|
||||
7z x $tempFile -o"$targetFolder" -aoa
|
||||
}
|
||||
|
||||
# Save install location for subsequent steps
|
||||
"NANO_QT_DIR=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5" >> $env:GITHUB_ENV
|
4
ci/prepare/windows/prepare.ps1
Normal file
4
ci/prepare/windows/prepare.ps1
Normal file
|
@ -0,0 +1,4 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
& "$PSScriptRoot\disable-defender.ps1"
|
||||
& "$PSScriptRoot\install-qt.ps1"
|
Loading…
Add table
Add a link
Reference in a new issue