Skip to content

Commit 0f1d138

Browse files
authored
Allow TestDriver to run on outside contributions (#1622)
1 parent c1cf539 commit 0f1d138

File tree

3 files changed

+83
-65
lines changed

3 files changed

+83
-65
lines changed

.github/workflows/merge-gatekeeper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
uses: upsidr/merge-gatekeeper@v1
2424
with:
2525
token: ${{ secrets.GITHUB_TOKEN }}
26-
ignored: Test Onboarding, Analyze (go), Analyze (javascript-typescript), License Compliance, CodeRabbit
26+
ignored: Build for TestDriver.ai, Analyze (go), Analyze (javascript-typescript), License Compliance, CodeRabbit
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: TestDriver.ai Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v[0-9]+.[0-9]+.[0-9]+*"
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- "docs/**"
14+
- ".storybook/**"
15+
- ".vscode/**"
16+
- ".editorconfig"
17+
- ".gitignore"
18+
- ".prettierrc"
19+
- ".eslintrc.js"
20+
- "**/*.md"
21+
schedule:
22+
- cron: 0 21 * * *
23+
workflow_dispatch: null
24+
25+
env:
26+
GO_VERSION: "1.23"
27+
NODE_VERSION: 22
28+
29+
permissions:
30+
contents: read # To allow the action to read repository contents
31+
pull-requests: write # To allow the action to create/update pull request comments
32+
33+
jobs:
34+
build_and_upload:
35+
name: Build for TestDriver.ai
36+
runs-on: windows-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
# General build dependencies
41+
- uses: actions/setup-go@v5
42+
with:
43+
go-version: ${{env.GO_VERSION}}
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: ${{env.NODE_VERSION}}
47+
- name: Install Yarn
48+
uses: nick-fields/retry@v3
49+
with:
50+
command: |
51+
corepack enable
52+
yarn install
53+
timeout_minutes: 5
54+
max_attempts: 3
55+
- name: Install Task
56+
uses: arduino/setup-task@v2
57+
with:
58+
version: 3.x
59+
repo-token: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Build
62+
run: task package
63+
env:
64+
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
65+
CSC_IDENTITY_AUTO_DISCOVERY: false # disable codesign
66+
shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell
67+
68+
# Upload .exe as an artifact
69+
- name: Upload .exe artifact
70+
id: upload
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: windows-exe
74+
path: make/*.exe

.github/workflows/testdriver.yml

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1-
name: TestDriver.ai
1+
name: TestDriver.ai Run
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
tags:
8-
- "v[0-9]+.[0-9]+.[0-9]+*"
9-
pull_request:
10-
branches:
11-
- main
12-
paths-ignore:
13-
- "docs/**"
14-
- ".storybook/**"
15-
- ".vscode/**"
16-
- ".editorconfig"
17-
- ".gitignore"
18-
- ".prettierrc"
19-
- ".eslintrc.js"
20-
- "**/*.md"
21-
schedule:
22-
- cron: 0 21 * * *
23-
workflow_dispatch: null
4+
workflow_run:
5+
workflows: ["TestDriver.ai Build"]
6+
types:
7+
- completed
248

259
env:
2610
GO_VERSION: "1.23"
@@ -31,50 +15,10 @@ permissions:
3115
pull-requests: write # To allow the action to create/update pull request comments
3216

3317
jobs:
34-
build_and_upload:
35-
name: Test Onboarding
18+
run_testdriver:
19+
name: Run TestDriver.ai
3620
runs-on: windows-latest
3721
steps:
38-
- uses: actions/checkout@v4
39-
40-
# General build dependencies
41-
- uses: actions/setup-go@v5
42-
with:
43-
go-version: ${{env.GO_VERSION}}
44-
cache-dependency-path: |
45-
go.sum
46-
- uses: actions/setup-node@v4
47-
with:
48-
node-version: ${{env.NODE_VERSION}}
49-
- name: Install Yarn
50-
uses: nick-fields/retry@v3
51-
with:
52-
command: |
53-
corepack enable
54-
yarn install
55-
timeout_minutes: 5
56-
max_attempts: 3
57-
- name: Install Task
58-
uses: arduino/setup-task@v2
59-
with:
60-
version: 3.x
61-
repo-token: ${{ secrets.GITHUB_TOKEN }}
62-
63-
- name: Build
64-
run: task package
65-
env:
66-
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
67-
CSC_IDENTITY_AUTO_DISCOVERY: false # disable codesign
68-
shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell
69-
70-
# Upload .exe as an artifact
71-
- name: Upload .exe artifact
72-
id: upload
73-
uses: actions/upload-artifact@v4
74-
with:
75-
name: windows-exe
76-
path: make/*.exe
77-
7822
- uses: testdriverai/action@main
7923
id: testdriver
8024
env:
@@ -102,7 +46,7 @@ jobs:
10246
10347
# Fetch the artifact upload URL
10448
Write-Host "Fetching the artifact upload URL..."
105-
$artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url
49+
$artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url
10650
10751
if ($artifactUrl) {
10852
Write-Host "Artifact URL successfully fetched: $artifactUrl"

0 commit comments

Comments
 (0)