Skip to content

Commit

Permalink
Try powershell for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Mar 4, 2025
1 parent 45c8d30 commit b0ed034
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,13 @@ jobs:
# Main installation loop
for PKG in $PACKAGES; do
timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly"
if [[ "${{matrix.TARGET}}" == win ]]; then
# Use PowerShell to run conda install with a timeout
powershell -Command "Start-Process conda -ArgumentList 'install', '-q', '-y', '$PKG' -NoNewWindow -Wait -Timeout 30; if ($LASTEXITCODE -ne 0) { Write-Host 'WARNING: $PKG not available or did not install correctly' }"
else
# For Linux or other environments
timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly"
fi
done
fi
# Re-try Pyomo (optional) dependencies with pip
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,13 @@ jobs:
# Main installation loop
for PKG in $PACKAGES; do
timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly"
if [[ "${{matrix.TARGET}}" == win ]]; then
# Use PowerShell to run conda install with a timeout
powershell -Command "Start-Process conda -ArgumentList 'install', '-q', '-y', '$PKG' -NoNewWindow -Wait -Timeout 30; if ($LASTEXITCODE -ne 0) { Write-Host 'WARNING: $PKG not available or did not install correctly' }"
else
# For Linux or other environments
timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly"
fi
done
fi
# Re-try Pyomo (optional) dependencies with pip
Expand Down

0 comments on commit b0ed034

Please sign in to comment.