TestDriver.ai Build #20
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: TestDriver.ai Build | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- "docs/**" | |
- ".storybook/**" | |
- ".vscode/**" | |
- ".editorconfig" | |
- ".gitignore" | |
- ".prettierrc" | |
- ".eslintrc.js" | |
- "**/*.md" | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
schedule: | |
- cron: 0 21 * * * | |
env: | |
GO_VERSION: "1.23" | |
NODE_VERSION: 22 | |
permissions: | |
contents: read # To allow the action to read repository contents | |
pull-requests: write # To allow the action to create/update pull request comments | |
actions: write # To allow the action to read actions | |
jobs: | |
build_and_upload: | |
name: Build for TestDriver.ai | |
runs-on: windows-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
# General build dependencies | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{env.GO_VERSION}} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{env.NODE_VERSION}} | |
- name: Install Yarn | |
uses: nick-fields/retry@v3 | |
with: | |
command: | | |
corepack enable | |
yarn install | |
timeout_minutes: 5 | |
max_attempts: 3 | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Zig | |
uses: mlugg/setup-zig@v1 | |
- 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 | |
- name: Print runId | |
run: | | |
echo "runId: ${{ github.run_id }}" | |
# Upload .exe as an artifact | |
- name: Upload .exe artifact | |
id: upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-exe | |
path: make/*.exe | |
- name: Dispatch testdriver workflow | |
if: success() | |
shell: pwsh | |
run: | | |
$headers = @{ | |
Accept = "application/vnd.github.v3+json" | |
Authorization = "Bearer ${{ secrets.PAT }}" | |
} | |
$body = @{ | |
event_type = "run-testdriver" | |
client_payload = @{ | |
pull_request_number = "${{ github.event.pull_request.number }}" | |
sha = "${{ github.sha }}" | |
workflow_run_id = "${{ github.run_id }}" | |
} | |
} | ConvertTo-Json | |
Invoke-RestMethod ` | |
-Uri "https://api.github.com/repos/${{ github.repository }}/dispatches" ` | |
-Method POST ` | |
-Headers $headers ` | |
-Body $body ` | |
-ContentType "application/json" |