This workflow's prerun script downloads an installer, then installs the software before running the tests
name: TestDriver.ai
permissions:
actions: read
contents: read
statuses: write
pull-requests: write
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: testdriverai/action@main
with:
key: ${{ secrets.TESTDRIVER_API_KEY }}
prompt: |
1. /run testdriver/test.yml
prerun: |
# Check IPv6 addresses (optional)
Get-NetIPAddress -AddressFamily IPv6
# URL for the installer
$installerUrl = "https://example.com/windows/ExampleInstaller.exe"
# Location to save the installer
$installerPath = "$env:USERPROFILE\Downloads\ExampleInstaller.exe"
# Download the installer
Write-Host "Downloading installer..."
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath
# Check if the download was successful
if (Test-Path $installerPath) {
Write-Host "Download successful. Running the installer..."
Start-Process -FilePath $installerPath -ArgumentList '/silent' -Wait
Start-Sleep -Seconds 10
} else {
Write-Host "Failed to download the
installer."
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_COLOR: "3"