fix(ci): use Windows Swift setup action

This commit is contained in:
Mihaela Mihaljevic 2026-06-05 21:28:54 +02:00
parent 9b4f091a53
commit fc43a3a643

View File

@ -53,26 +53,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Swift
shell: pwsh
run: |
$swift = Get-Command swift -ErrorAction SilentlyContinue
if (-not $swift) {
winget install --id Swift.Toolchain --exact --source winget --accept-source-agreements --accept-package-agreements --disable-interactivity
$roots = @(
"$env:ProgramFiles\Swift",
"${env:ProgramFiles(x86)}\Swift"
) | Where-Object { $_ -and (Test-Path $_) }
$swift = $roots |
ForEach-Object { Get-ChildItem -Path $_ -Recurse -Filter swift.exe -ErrorAction SilentlyContinue } |
Select-Object -First 1
if (-not $swift) {
throw "Swift executable not found after WinGet installation"
}
$bin = $swift.Directory.FullName
Add-Content -Path $env:GITHUB_PATH -Value $bin
$env:Path = "$bin;$env:Path"
}
swift --version
uses: compnerd/gha-setup-swift@main
with:
swift-version: swift-6.3.2-release
swift-build: 6.3.2-RELEASE
- name: Build and test
shell: pwsh
run: ./scripts/check-windows.ps1