Skip to content

Commit e01ae67

Browse files
authored
Update issue1050.yml
1 parent cdf9f21 commit e01ae67

1 file changed

Lines changed: 2 additions & 48 deletions

File tree

.github/workflows/issue1050.yml

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,59 +9,13 @@ jobs:
99

1010
steps:
1111
- name: Checkout code
12-
uses: actions/checkout@v3
13-
14-
- name: Install Python (if not already installed)
15-
shell: powershell
16-
run: |
17-
# Check if Python is already installed
18-
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
19-
Write-Host "Python not found, installing..."
20-
# Download and Install Python
21-
$pythonInstallerUrl = "https://www.python.org/ftp/python/3.13.0/python-3.13.0.exe"
22-
$installerPath = "$env:temp\python-installer.exe"
23-
Invoke-WebRequest -Uri $pythonInstallerUrl -OutFile $installerPath
24-
# Install Python and make sure it's added to the PATH
25-
Start-Process -FilePath $installerPath -ArgumentList "/quiet", "InstallAllUsers=1", "PrependPath=1" -Wait
26-
Write-Host "Python installed"
27-
} else {
28-
Write-Host "Python already installed"
29-
}
30-
31-
# Refresh the environment to pick up the new PATH
32-
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine)
33-
34-
# Verify if Python is installed and accessible
35-
$pythonPath = Get-Command python -ErrorAction SilentlyContinue
36-
if ($pythonPath) {
37-
Write-Host "Python found at $pythonPath"
38-
} else {
39-
Write-Host "Python installation failed. Exiting."
40-
exit 1
41-
}
42-
43-
- name: Install pip (if not already installed)
44-
shell: powershell
45-
run: |
46-
# Check if pip is already installed
47-
if (-not (Get-Command pip -ErrorAction SilentlyContinue)) {
48-
Write-Host "pip not found, installing..."
49-
# Install pip using Python
50-
python -m ensurepip --upgrade
51-
python -m pip install --upgrade pip
52-
Write-Host "pip installed"
53-
} else {
54-
Write-Host "pip already installed"
55-
}
12+
uses: actions/checkout@v4
5613

5714
- name: Set up Python
58-
uses: actions/setup-python@v5
15+
uses: gowridurgad/setup-python@v5
5916
with:
6017
python-version: '3.13'
6118
cache: 'pip'
6219
cache-dependency-path: 'requirements.txt'
6320
update-environment: false # Do not update environment
6421

65-
- name: Install dependencies
66-
run: |
67-
pip install -r requirements.txt

0 commit comments

Comments
 (0)