Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2828cc8
update for v4 + new main
ianjennings Sep 26, 2024
05d28da
use choco instead
ianjennings Sep 26, 2024
f4354b3
update prerun
ianjennings Sep 27, 2024
85957a7
build and upload as artifact then download to vm
ianjennings Sep 30, 2024
1005cc8
Update testdriver.yml
ianjennings Sep 30, 2024
2dd02bd
Update testdriver.yml
ianjennings Sep 30, 2024
587c159
try prerun with artifact download
ianjennings Sep 30, 2024
0aad99e
try prerun with artifact download
ianjennings Sep 30, 2024
6d4735c
small fix?
ianjennings Sep 30, 2024
1b62c61
juse use invokewebrequest
ianjennings Sep 30, 2024
14e32b7
proper vars
ianjennings Sep 30, 2024
fbd5490
try dynamic artifact url download
ianjennings Oct 1, 2024
c67dad2
try
ianjennings Oct 1, 2024
48ded14
needs
ianjennings Oct 1, 2024
b38aaf1
write output url
ianjennings Oct 1, 2024
872d251
debug
ianjennings Oct 1, 2024
d7549f7
fix steps
ianjennings Oct 1, 2024
e43f20d
Update testdriver.yml
ianjennings Oct 1, 2024
474ca52
maybe v4 is needed
ianjennings Oct 1, 2024
f4fd17c
ai gives it a shot
ianjennings Oct 1, 2024
58a9162
add debugging info, remove chmod
ianjennings Oct 1, 2024
5e1717f
make sure we unzip first
ianjennings Oct 2, 2024
c4b78ba
try to run after download and install
ianjennings Oct 3, 2024
6892b36
specify exe
ianjennings Oct 3, 2024
7749ac1
did something break codesigning?
ianjennings Oct 7, 2024
1027792
complete the onboarding
ianjennings Oct 7, 2024
7b1d85c
Merge branch 'main' into testdriverai/v4-windows-main
ianjennings Oct 10, 2024
be5fe7d
testonboarding.yml and generate 20 tests
ianjennings Oct 10, 2024
fd93196
remove signing from workflow
esimkowitz Oct 14, 2024
6ee3dad
drop csc fields
ianjennings Oct 15, 2024
d7ca0a5
try CSC_IDENTITY_AUTO_DISCOVERY false
ianjennings Oct 15, 2024
4c6245f
revert config.cjs changes, see if it still works
ianjennings Oct 15, 2024
78214d4
modify config.cjs at runtime
ianjennings Oct 16, 2024
a2a6651
add CSC_IDENTITY_AUTO_DISCOVERY again
ianjennings Oct 16, 2024
d1c310a
revert to original
ianjennings Oct 16, 2024
3804941
Merge branch 'main' into testdriverai/v4-windows-main
esimkowitz Oct 17, 2024
f9405e7
use ai method
ianjennings Oct 17, 2024
875f812
output color
ianjennings Oct 17, 2024
ed62b06
remove ai method
ianjennings Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions .github/workflows/testdriver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: TestDriver.ai

on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches:
- main
schedule:
- cron: 0 21 * * *
workflow_dispatch: null

env:
GO_VERSION: "1.22"
NODE_VERSION: "20"

permissions:
contents: read # To allow the action to read repository contents
pull-requests: write # To allow the action to create/update pull request comments

jobs:
build_and_upload:
name: Test Onboarding
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

# General build dependencies
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: |
go.sum
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install Yarn
run: |
corepack enable
yarn install
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: task package
env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
CSC_IDENTITY_AUTO_DISCOVERY: false # disable codesign
shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell

# Upload .exe as an artifact
- name: Upload .exe artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: windows-exe
path: make/*.exe

- uses: testdriverai/action@main
id: testdriver
env:
FORCE_COLOR: "3"
with:
key: ${{ secrets.DASHCAM_API }}
prerun: |
$headers = @{
Authorization = "token ${{ secrets.GITHUB_TOKEN }}"
}

$downloadFolder = "./download"
$artifactFileName = "waveterm.exe"
$artifactFilePath = "$downloadFolder/$artifactFileName"

Write-Host "Starting the artifact download process..."

# Create the download directory if it doesn't exist
if (-not (Test-Path -Path $downloadFolder)) {
Write-Host "Creating download folder..."
mkdir $downloadFolder
} else {
Write-Host "Download folder already exists."
}

# Fetch the artifact upload URL
Write-Host "Fetching the artifact upload URL..."
$artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url

if ($artifactUrl) {
Write-Host "Artifact URL successfully fetched: $artifactUrl"
} else {
Write-Error "Failed to fetch the artifact URL."
exit 1
}

# Download the artifact (zipped file)
Write-Host "Starting artifact download..."
$artifactZipPath = "$env:TEMP\artifact.zip"
try {
Invoke-WebRequest -Uri $artifactUrl `
-Headers $headers `
-OutFile $artifactZipPath `
-MaximumRedirection 5

Write-Host "Artifact downloaded successfully to $artifactZipPath"
} catch {
Write-Error "Error downloading artifact: $_"
exit 1
}

# Unzip the artifact
$artifactUnzipPath = "$env:TEMP\artifact"
Write-Host "Unzipping the artifact to $artifactUnzipPath..."
try {
Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force
Write-Host "Artifact unzipped successfully to $artifactUnzipPath"
} catch {
Write-Error "Failed to unzip the artifact: $_"
exit 1
}

# Find the installer or app executable
$artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1

if ($artifactInstallerPath) {
Write-Host "Executable file found: $($artifactInstallerPath.FullName)"
} else {
Write-Error "Executable file not found. Exiting."
exit 1
}

# Run the installer and log the result
Write-Host "Running the installer: $($artifactInstallerPath.FullName)..."
try {
Start-Process -FilePath $artifactInstallerPath.FullName -Wait
Write-Host "Installer ran successfully."
} catch {
Write-Error "Failed to run the installer: $_"
exit 1
}

# Optional: If the app executable is different from the installer, find and launch it
$wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe"

Write-Host "Launching the application: $($wavePath)"
Start-Process -FilePath $wavePath
Write-Host "Application launched."

prompt: |
1. /run testdriver/onboarding.yml
2. /generate desktop 20
12 changes: 12 additions & 0 deletions testdriver/onboarding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 4.0.65
steps:
- prompt: complete the onboarding of wave terminal
commands:
- command: hover-text
text: Continue
description: button to complete onboarding
action: click
- command: hover-text
text: Get Started
description: button to complete onboarding
action: click