-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (71 loc) · 3.49 KB
/
testdriver.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: TestDriver.ai
permissions:
actions: read
contents: write
pull-requests: write
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
test:
name: "TestDriver"
runs-on: ubuntu-latest
steps:
- uses: testdriverai/action@main
with:
key: ${{ secrets.TESTDRIVER_API_KEY }}
prompt: |
1. /run testdriver/test.yml
prerun: |
# Define variables
$osInstallerUrl = "https://builds.pieces.app/stages/production/os_server/windows-exe/download"
$appInstallerUrl = "https://builds.pieces.app/stages/production/pieces_for_x/windows-exe/download"
$osInstallerPath = "$env:USERPROFILE\Downloads\out-windows.exe"
$appInstallerPath = "$env:USERPROFILE\Downloads\out-windows (1).exe"
function Install-Application($installerUrl, $installerPath, $appName) {
Write-Host "$(Get-Date -Format G): Starting download of $appName installer..."
# Create WebClient object
$webClient = New-Object System.Net.WebClient
$progressEvent = Register-ObjectEvent -InputObject $webClient -EventName DownloadProgressChanged -Action {
$percent = $EventArgs.ProgressPercentage
Write-Host "$(Get-Date -Format G): Downloading $($using:appName) - $percent% complete"
}
# Download file asynchronously
$webClient.DownloadFileAsync($installerUrl, $installerPath)
while ($webClient.IsBusy) {
Start-Sleep -Milliseconds 500
}
Unregister-Event -SourceIdentifier $progressEvent.Name
Remove-Job -Name $progressEvent.Name
Write-Host "$(Get-Date -Format G): $appName installer download complete."
if (Test-Path $installerPath) {
Write-Host "$(Get-Date -Format G): Running the $appName installer..."
Start-Process -FilePath $installerPath -ArgumentList '/SILENT' -Wait
Start-Sleep -Seconds 10
} else {
Write-Host "$(Get-Date -Format G): Failed to download the $appName installer."
}
}
Install-Application $osInstallerUrl $osInstallerPath "Pieces OS Server"
Install-Application $appInstallerUrl $appInstallerPath "Pieces Application"
Write-Host "$(Get-Date -Format G): Attempting to start the Pieces OS Server..."
$osServerExePath = "C:\Program Files\Pieces OS\os_server.exe"
if (Test-Path $osServerExePath) {
Start-Process -FilePath $osServerExePath -ArgumentList '/SILENT'
Write-Host "$(Get-Date -Format G): Pieces OS Server started successfully."
} else {
Write-Host "$(Get-Date -Format G): Failed to find the Pieces OS Server executable."
}
Start-Sleep -Seconds 5
Write-Host "$(Get-Date -Format G): Attempting to start the Pieces application..."
$piecesExePath = "C:\Program Files\Pieces for Developers\pieces_for_x.exe"
if (Test-Path $piecesExePath) {
Start-Process -FilePath $piecesExePath
Write-Host "$(Get-Date -Format G): Pieces application started successfully."
} else {
Write-Host "$(Get-Date -Format G): Failed to find the Pieces application executable."
}
env:
FORCE_COLOR: "3"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}