fix(ci): use Windows Swift setup action
This commit is contained in:
parent
9b4f091a53
commit
fc43a3a643
24
.github/workflows/ci.yml
vendored
24
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user