TestDriver v4 #14
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
name: Build and TestDriver.ai Regression Testing - Waveterm | |
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: Build and Upload EXE | |
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 }} | |
# Windows Code Signing Setup | |
- name: Set up certificate (Windows only) | |
run: | | |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12 | |
shell: bash | |
- name: Set signing variables (Windows only) | |
id: variables | |
run: | | |
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV" | |
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV" | |
echo "SM_CODE_SIGNING_CERT_SHA1_HASH=${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}" >> "$GITHUB_ENV" | |
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV" | |
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV" | |
shell: bash | |
- name: Build the Windows package | |
run: task package | |
env: | |
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one. | |
CSC_LINK: ${{ steps.variables.outputs.SM_CLIENT_CERT_FILE }} | |
CSC_KEY_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }} | |
shell: powershell | |
# Upload .exe as an artifact | |
- name: Upload .exe artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-exe | |
path: make/*.exe | |
testdriver: | |
name: TestDriver Regression Test | |
runs-on: ubuntu-latest | |
needs: build_and_upload | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifact and run .exe | |
run: | | |
mkdir -p download | |
curl -L --output ./download/waveterm.exe "${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/windows-exe" | |
chmod +x ./download/waveterm.exe | |
powershell -Command ./download/waveterm.exe | |
- uses: testdriverai/action@main | |
id: testdriver | |
with: | |
key: ${{ secrets.DASHCAM_API }} | |
prerun: | | |
# PowerShell script to run the downloaded .exe | |
powershell -Command " | |
Start-Process -FilePath './download/waveterm.exe' -NoNewWindow; | |
" | |
prompt: | | |
1. /run testdriver/theme.yml |