Skip to content

Commit df7f04a

Browse files
committed
Install Python 3.9 on 6.1 and lower
The underlying Windows image has been updated to remove Python 3.9. Swift toolchains version 6.1 and lower require Python 3.9. Install it for these toolchains, and continue to install 3.10 for toolchains > 6.1.
1 parent 1ffcd38 commit df7f04a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/swift_package_test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,17 @@ jobs:
730730
docker pull $Image
731731
echo "image=$Image" >> "$env:GITHUB_OUTPUT"
732732
- name: "Install Python 3.10"
733-
if: ${{ !inputs.enable_windows_docker }}
733+
if: ${{ !inputs.enable_windows_docker && !(matrix.swift_version == '6.1' || matrix.swift_version == '6.0' || matrix.swift_version == '5.10' || matrix.swift_version == '5.9') }}
734734
uses: actions/setup-python@v6
735735
with:
736736
python-version: "3.10"
737737
architecture: "x64"
738+
- name: "Install Python 3.9"
739+
if: ${{ !inputs.enable_windows_docker && (matrix.swift_version == '6.1' || matrix.swift_version == '6.0' || matrix.swift_version == '5.10' || matrix.swift_version == '5.9') }}
740+
uses: actions/setup-python@v6
741+
with:
742+
python-version: "3.9"
743+
architecture: "x64"
738744
- name: Install Visual Studio Build Tools
739745
if: ${{ !inputs.enable_windows_docker }}
740746
run: . ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/windows/install-vsb.ps1
@@ -789,3 +795,4 @@ jobs:
789795
timeout-minutes: 60
790796
if: ${{ !inputs.enable_windows_docker }}
791797
run: powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1; exit $LastExitCode
798+

0 commit comments

Comments
 (0)