Skip to content

Commit c634a47

Browse files
authored
Update issue1050.yml
1 parent 0d04ae7 commit c634a47

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/issue1050.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,41 @@ jobs:
99

1010
steps:
1111
- name: Checkout code
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v3
1313

1414
- name: Install Python (if not already installed)
1515
shell: powershell
1616
run: |
17+
# Check if Python is already installed
1718
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
1819
Write-Host "Python not found, installing..."
19-
# Install Python (adjust the path and version as necessary)
20+
# Download and Install Python
2021
$pythonInstallerUrl = "https://www.python.org/ftp/python/3.13.0/python-3.13.0.exe"
2122
$installerPath = "$env:temp\python-installer.exe"
2223
Invoke-WebRequest -Uri $pythonInstallerUrl -OutFile $installerPath
24+
# Install Python and make sure it's added to the PATH
2325
Start-Process -FilePath $installerPath -ArgumentList "/quiet", "InstallAllUsers=1", "PrependPath=1" -Wait
2426
Write-Host "Python installed"
2527
} else {
2628
Write-Host "Python already installed"
2729
}
2830
29-
- name: Install pip
31+
# Verify if Python is installed and accessible
32+
$pythonPath = Get-Command python -ErrorAction SilentlyContinue
33+
if ($pythonPath) {
34+
Write-Host "Python found at $pythonPath"
35+
} else {
36+
Write-Host "Python installation failed. Exiting."
37+
exit 1
38+
}
39+
40+
- name: Install pip (if not already installed)
3041
shell: powershell
3142
run: |
43+
# Check if pip is already installed
3244
if (-not (Get-Command pip -ErrorAction SilentlyContinue)) {
3345
Write-Host "pip not found, installing..."
46+
# Install pip using Python
3447
python -m ensurepip --upgrade
3548
python -m pip install --upgrade pip
3649
Write-Host "pip installed"

0 commit comments

Comments
 (0)