Skip to content

Commit

Permalink
ci: Shutdown only if there are running distributions
Browse files Browse the repository at this point in the history
Signed-off-by: Subash Kotha <[email protected]>
  • Loading branch information
Subash Kotha committed Nov 13, 2024
1 parent efeaa44 commit 1109763
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build-and-test-msi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ jobs:
run: |
$ErrorActionPreference = 'Ignore'
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
echo "WSL has been shut down successfully."
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
wsl --list --verbose --all
Expand Down Expand Up @@ -153,9 +153,9 @@ jobs:
# We want these cleanup commands to always run, ignore errors so the step completes.
$ErrorActionPreference = 'Ignore'
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
echo "WSL has been shut down successfully."
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
wsl --list --verbose --all
Expand Down Expand Up @@ -209,9 +209,9 @@ jobs:
# We want these cleanup commands to always run, ignore errors so the step completes.
$ErrorActionPreference = 'Ignore'
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
echo "WSL has been shut down successfully."
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
wsl --list --verbose --all
Expand Down Expand Up @@ -257,9 +257,9 @@ jobs:
# We want these cleanup commands to always run, ignore errors so the step completes.
$ErrorActionPreference = 'Ignore'
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
echo "WSL has been shut down successfully."
Start-Sleep -s 10
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
Expand Down Expand Up @@ -295,9 +295,9 @@ jobs:
# We want these cleanup commands to always run, ignore errors so the step completes.
$ErrorActionPreference = 'Ignore'
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
echo "WSL has been shut down successfully."
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
wsl --list --verbose --all
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
wsl --list --verbose --all
- name: Clean up previous files
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0"
wsl --list --verbose
sc query LxssManager | findstr "STATE" | findstr /C:"STOPPED" > nul && net start LxssManager
wsl --shutdown
wsl --list --verbose | findstr /C:"Running" > nul && wsl --shutdown
wsl --list --quiet | findstr /C:"lima-finch" > nul && wsl --unregister lima-finch
wsl --list --verbose --all
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse
Expand Down

0 comments on commit 1109763

Please sign in to comment.