Skip to content

Commit 9fac9c4

Browse files
Update windows job to use SWIG 4.2.1
1 parent 4587e85 commit 9fac9c4

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/pull-request.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ jobs:
186186
# - name: "Install swig and cmake"
187187
# shell: pwsh
188188
# run: choco install swig cmake -y
189+
- name: "Install SWIG 4.2.1"
190+
shell: pwsh
191+
run: |
192+
$swigDir = "C:\Program Files\SWIG"
193+
if (!(Test-Path $swigDir)) {New-Item -ItemType Directory -Path $swigDir | Out-Null}
194+
$swigZip = "$swigDir\swigwin-4.2.1.zip"
195+
$swigUrl = "https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.2.1/swigwin-4.2.1.zip/download"
196+
Start-Process -NoNewWindow -Wait -FilePath "curl.exe" -ArgumentList "-L -o `"$swigZip`" `"$swigUrl`""
197+
if (!(Test-Path $swigZip) -or ((Get-Item $swigZip).Length -lt 500KB)) { Write-Host "Download failed or file is corrupted." }
198+
Expand-Archive -Path $swigZip -DestinationPath $swigDir -Force
189199
- name: "Create python virtual env"
190200
shell: pwsh
191201
run: python -m venv venv
@@ -194,12 +204,12 @@ jobs:
194204
run: |
195205
venv\Scripts\activate
196206
pip install -r requirements_dev.txt pytest-error-for-skips
197-
- name: "Add basilisk and cmake path to env path"
207+
- name: "Add basilisk, swig, and cmake path to env path"
198208
shell: pwsh
199209
run: |
200210
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
201-
$newpath = “$oldpath;${{ env.GITHUB_WORKSPACE }}\dist3\Basilisk;C:\Program Files\CMake\bin”
202-
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
211+
$newPath = “C:\Program Files\SWIG\swigwin-4.2.1;$oldpath;${{ env.GITHUB_WORKSPACE }}\dist3\Basilisk;C:\Program Files\CMake\bin”
212+
echo "PATH=$newPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
203213
- name: "Build basilisk"
204214
shell: pwsh
205215
run: |

0 commit comments

Comments
 (0)