-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: apply WSL hanging workaround to MSI builder
This change refactors the WSL hanging workaround into a reusable GitHub composite action and applies it to the MSI builder workflow. Signed-off-by: Austin Vazquez <[email protected]>
- Loading branch information
1 parent
12b6934
commit dbd3b7c
Showing
3 changed files
with
62 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Clean Up Windows Environment" | ||
description: "Reusable action to clean up the virtual machine for Finch on Windows" | ||
inputs: | ||
deep-clean: | ||
default: true | ||
description: "Clean up Finch virtual machine and configuration files only" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Remove Finch VM | ||
timeout: 3 minutes | ||
run: | | ||
wsl --list --verbose | ||
wsl --shutdown | ||
wsl --unregister lima-finch | ||
wsl --list --verbose | ||
# This is a workaround for https://github.com/microsoft/WSL/issues/8529 | ||
# | ||
# If WSL is suspected of hanging for longer than 180 seconds, then | ||
# kill the WSL service and retry the shutdown command. | ||
- name: Force remove Finch VM | ||
needs: remove-vm | ||
if: failure() | ||
timeout: 3 minutes | ||
run: | | ||
$ErrorActionPreference = 'Ignore' | ||
taskkill /f /im wslservice.exe 2> nul || cmd /c "exit /b 0" | ||
wsl --list --verbose | ||
wsl --shutdown | ||
Start-Sleep -s 10 | ||
wsl --unregister lima-finch | ||
wsl --list --verbose | ||
- name: Clean up Finch application data | ||
run: | | ||
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse -ErrorAction Ignore | ||
exit 0 # Cleanup may set the exit code e.g. if a file doesn't exist; just ignore | ||
- name: Clean up Finch configuration and artifacts | ||
if: inputs.deep-clean | ||
run: | | ||
Remove-Item C:\Users\Administrator\.finch -Recurse -ErrorAction Ignore | ||
make clean | ||
exit 0 # Cleanup may set the exit code e.g. if a file doesn't exist; just ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters