From 87ce131cc3498801fb3e2a6cac1e6ebd03e7f88c Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Wed, 13 Aug 2025 17:30:20 -0700 Subject: [PATCH 1/5] Bump the default minimum Swift version to 5.9 in package tests --- .github/workflows/swift_package_test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index d29b835..344b4d5 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -22,7 +22,7 @@ on: linux_swift_versions: type: string description: "Include Linux Swift version list (JSON)" - default: "[ \"5.9\", \"5.10\", \"6.0\", \"6.1\", \"nightly-main\", \"nightly-6.2\"]" + default: "[ \"5.10\", \"6.0\", \"6.1\", \"nightly-main\", \"nightly-6.2\"]" linux_exclude_swift_versions: type: string description: "Exclude Linux Swift version list (JSON)" @@ -46,8 +46,7 @@ on: windows_swift_versions: type: string description: "Include Windows Swift version list (JSON)" - # "5.10" is omitted for Windows because the container image is broken. - default: "[\"5.9\", \"6.0\", \"6.1\", \"nightly\", \"nightly-6.2\"]" + default: "[\"5.10\", \"6.0\", \"6.1\", \"nightly\", \"nightly-6.2\"]" windows_exclude_swift_versions: type: string description: "Exclude Windows Swift version list (JSON)" From c4ddc5103278e3237ad881374c6a8a632617a541 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Fri, 15 Aug 2025 15:36:20 -0700 Subject: [PATCH 2/5] [Debug] Swift 5.10 with Docker image --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a450674..6ac39cc 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -46,7 +46,7 @@ jobs: mkdir MyPackage cd MyPackage swift package init --type library - swift build + swift build -vv enable_windows_docker: true tests_without_docker: From 8778810116987a6e17d50ad249e0967e1b75122a Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Fri, 15 Aug 2025 16:19:09 -0700 Subject: [PATCH 3/5] Try use ErrorActionPreference instead of Invoke-Program --- .github/workflows/swift_package_test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index 344b4d5..a8e9500 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -97,10 +97,7 @@ on: default: "" windows_build_command: type: string - description: | - Windows Command Prompt command to build and test the package. - Note that Powershell does not automatically exit if a subcommand fails. The Invoke-Program utility is available to propagate non-zero exit codes. - It is strongly encouraged to run all command using `Invoke-Program` unless you want to continue on error eg. `Invoke-Program git apply patch.diff` instead of `git apply patch.diff`. + description: "Windows Command Prompt command to build and test the package" default: "swift test" macos_env_vars: description: "Newline separated list of environment variables" @@ -386,6 +383,8 @@ jobs: mkdir $env:TEMP\test-script echo @' Set-PSDebug -Trace 1 + $ErrorActionPreference = 'Stop' + if ("${{ inputs.enable_windows_docker }}" -eq "true") { $Source = "C:\source" } else { @@ -400,11 +399,12 @@ jobs: exit $LastExitCode } } - Invoke-Program swift --version - Invoke-Program swift test --version - Invoke-Program cd $Source + + swift --version + swift test --version + cd $Source ${{ inputs.windows_pre_build_command }} - Invoke-Program ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} + ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} '@ >> $env:TEMP\test-script\run.ps1 # Docker build - name: Docker Build / Test From 6198ab2dde98dcb3bccaa120048dd48522465819 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Fri, 15 Aug 2025 17:30:37 -0700 Subject: [PATCH 4/5] Try invoke-program instead --- .github/workflows/pull_request.yml | 8 ++++---- .github/workflows/swift_package_test.yml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6ac39cc..1e4711a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -45,8 +45,8 @@ jobs: windows_build_command: | mkdir MyPackage cd MyPackage - swift package init --type library - swift build -vv + Invoke-Program swift package init --type library + Invoke-Program swift build -vv enable_windows_docker: true tests_without_docker: @@ -59,8 +59,8 @@ jobs: windows_build_command: | mkdir MyPackage cd MyPackage - swift package init --type library - swift build + Invoke-Program swift package init --type library + Invoke-Program swift build enable_windows_docker: false tests_macos: diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index a8e9500..2ba37d1 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -97,8 +97,11 @@ on: default: "" windows_build_command: type: string - description: "Windows Command Prompt command to build and test the package" - default: "swift test" + description: | + Windows Command Prompt command to build and test the package. + Note that Powershell does not automatically exit if a subcommand fails. The Invoke-Program utility is available to propagate non-zero exit codes. + It is strongly encouraged to run all command using `Invoke-Program` unless you want to continue on error eg. `Invoke-Program git apply patch.diff` instead of `git apply patch.diff`. + default: "Invoke-Program swift test" macos_env_vars: description: "Newline separated list of environment variables" type: string @@ -383,8 +386,6 @@ jobs: mkdir $env:TEMP\test-script echo @' Set-PSDebug -Trace 1 - $ErrorActionPreference = 'Stop' - if ("${{ inputs.enable_windows_docker }}" -eq "true") { $Source = "C:\source" } else { @@ -399,12 +400,11 @@ jobs: exit $LastExitCode } } - - swift --version - swift test --version - cd $Source + Invoke-Program swift --version + Invoke-Program swift test --version + Invoke-Program cd $Source ${{ inputs.windows_pre_build_command }} - ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} + Invoke-Program ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} '@ >> $env:TEMP\test-script\run.ps1 # Docker build - name: Docker Build / Test From 470ed66890201c425172a685feaf5c6c0592e1c2 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Thu, 21 Aug 2025 14:29:20 -0700 Subject: [PATCH 5/5] Add verbose to non-docker --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1e4711a..d62625f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -60,7 +60,7 @@ jobs: mkdir MyPackage cd MyPackage Invoke-Program swift package init --type library - Invoke-Program swift build + Invoke-Program swift build -vv enable_windows_docker: false tests_macos: