Skip to content

Commit dac27b2

Browse files
committed
ci: clean up windows browsers
1 parent a76f797 commit dac27b2

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/ui-tests.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ jobs:
315315
} else {
316316
pip install -r sample/Tests/requirements-desktop.txt
317317
}
318+
- name: Kill leftover Brave processes
319+
if: always()
320+
run: |
321+
Get-Process -Name "brave" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
322+
if (Test-Path "C:\temp\brave_debug") { Remove-Item -Recurse -Force "C:\temp\brave_debug" -ErrorAction SilentlyContinue }
318323
- name: Run UI tests
319324
env:
320325
UNITY_APP_PATH: Sample Unity 6 Windows.exe
@@ -324,6 +329,11 @@ jobs:
324329
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
325330
working-directory: sample-unity6/Tests
326331
run: python -m pytest -xs test/test_windows.py::WindowsTest
332+
- name: Close Brave Browser
333+
if: always()
334+
run: |
335+
Get-Process -Name "brave" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
336+
if (Test-Path "C:\temp\brave_debug") { Remove-Item -Recurse -Force "C:\temp\brave_debug" -ErrorAction SilentlyContinue }
327337
- name: Upload build log
328338
if: always()
329339
uses: actions/upload-artifact@v4
@@ -396,6 +406,11 @@ jobs:
396406
- name: Install dependencies (Mac)
397407
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
398408
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
409+
- name: Kill leftover Brave processes (Windows)
410+
if: matrix.targetPlatform == 'StandaloneWindows64' && always()
411+
run: |
412+
Get-Process -Name "brave" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
413+
if (Test-Path "C:\temp\brave_debug") { Remove-Item -Recurse -Force "C:\temp\brave_debug" -ErrorAction SilentlyContinue }
399414
- name: Run UI tests
400415
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
401416
env:
@@ -406,12 +421,17 @@ jobs:
406421
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
407422
working-directory: ${{ matrix.projectPath }}/Tests
408423
run: ${{ matrix.test_script }}
409-
- name: Close Brave Browser
424+
- name: Close Brave Browser (macOS)
410425
if: contains(matrix.targetPlatform, 'StandaloneOSX') && always()
411426
run: |
412427
osascript -e 'tell application "Brave Browser" to quit' 2>/dev/null || true
413428
sleep 2
414429
pkill -f "Brave Browser" 2>/dev/null || true
430+
- name: Close Brave Browser (Windows)
431+
if: matrix.targetPlatform == 'StandaloneWindows64' && always()
432+
run: |
433+
Get-Process -Name "brave" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
434+
if (Test-Path "C:\temp\brave_debug") { Remove-Item -Recurse -Force "C:\temp\brave_debug" -ErrorAction SilentlyContinue }
415435
- name: Remove temporary keychain
416436
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
417437
run: |

0 commit comments

Comments
 (0)