Skip to content

ci: use official Swift installer with explicit dir in Windows spike #3

ci: use official Swift installer with explicit dir in Windows spike

ci: use official Swift installer with explicit dir in Windows spike #3

Workflow file for this run

name: Windows spike
# Throwaway spike (step 1 of PLAN.md): try to build the shared core
# (Sources/HeadlessProtocol) with Swift-for-Windows on a real runner.
# Delete this file once the spike outcome is recorded.
on:
push:
branches: [spike/windows-core]
workflow_dispatch:
permissions:
contents: read
jobs:
core-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Swift toolchain
shell: pwsh
run: |
$url = 'https://download.swift.org/swift-6.3.3-release/windows10/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE-windows10.exe'
Invoke-WebRequest $url -OutFile swift-installer.exe
Start-Process .\swift-installer.exe -ArgumentList '/VERYSILENT','/SUPPRESSMSGBOXES','/DIR=C:\Swift' -Wait
if (-not (Test-Path 'C:\Swift\bin\swift.exe')) {
Get-ChildItem 'C:\Swift' -Recurse -Filter '*.exe' -ErrorAction SilentlyContinue |
Select-Object -First 20 -ExpandProperty FullName
throw 'swift.exe not at C:\Swift\bin after silent install'
}
Add-Content $env:GITHUB_PATH 'C:\Swift\bin'
Add-Content $env:GITHUB_PATH 'C:\Swift\usr\bin'
- name: Set up MSVC environment
uses: ilammy/msvc-dev-cmd@v1
- name: Show toolchain
shell: pwsh
run: swift --version
- name: Build shared core (HeadlessProtocol)
shell: pwsh
working-directory: apps/headless
run: swift build --target HeadlessProtocol --build-tests-off 2>&1 | Tee-Object core-build.log
- name: Build protocol test executable
if: success() || failure()
shell: pwsh
working-directory: apps/headless
run: swift build --product headless-protocol-tests 2>&1 | Tee-Object tests-build.log
- name: Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-spike-logs
path: |
apps/headless/core-build.log
apps/headless/tests-build.log
if-no-files-found: ignore