Skip to content

Commit

Permalink
github action #118
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefvand committed Nov 26, 2024
1 parent 3579839 commit 93655bf
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
$success = $false
while (-not $success -and $retryCount -lt $maxRetries) {
try {
Invoke-WebRequest -Uri $bisonUrl -OutFile $bisonZip -UseBasicParsing
Invoke-WebRequest -Uri $bisonUrl -OutFile $bisonZip -UseBasicParsing -MaximumRedirection 5
$success = $true
} catch {
$retryCount++
Expand All @@ -92,13 +92,19 @@ jobs:
exit 1
}
# Extract the ZIP archive
try {
Expand-Archive -Path $bisonZip -DestinationPath $bisonDir -Force
} catch {
Write-Host "Error extracting bison ZIP file. Exiting."
# Extract the ZIP archive using 7-Zip
$sevenZipPath = "C:\Program Files\7-Zip\7z.exe"
if (-not (Test-Path $sevenZipPath)) {
choco install 7zip -y
}
Start-Process -FilePath $sevenZipPath -ArgumentList "x `"$bisonZip`" -o`"$bisonDir`" -y" -NoNewWindow -Wait
# Ensure extraction succeeded
if (-not (Test-Path "$bisonDir\bin\bison.exe")) {
Write-Host "Error: bison could not be extracted. Exiting."
exit 1
}
$env:PATH += ";$bisonDir\bin"
[System.Environment]::SetEnvironmentVariable("PATH", $env:PATH, [System.EnvironmentVariableTarget]::Process)
} else {
Expand Down

0 comments on commit 93655bf

Please sign in to comment.