-
Notifications
You must be signed in to change notification settings - Fork 636
96 lines (93 loc) · 3.86 KB
/
ui_smoke_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: UI Smoke Tests
on:
workflow_run:
workflows:
- Build DynamoAll.sln net8.0
types:
- completed
env:
TEST_EXECUTE_DOWNLOAD_URL: https://downloads.smartbear.com/TestExecute1559SLM.exe
WORKFLOW_RUN_WORKFLOW_ID: ${{ github.event.workflow_run.workflow_id }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
WORKFLOW_RUN_NAME: ${{ github.event.workflow_run.name }}
WORKFLOW_RUN_HTML_URL: ${{ github.event.workflow_run.html_url }}
jobs:
ui_smoke_tests:
name: UI Smoke Tests
timeout-minutes: 60
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: DynamoDS/DynamoTestCompleteTests
token: ${{ secrets.DYNAMO_TESTS_TOKEN }}
ref: master
- name: Download TestExecute
run: Invoke-WebRequest -Uri $env:TEST_EXECUTE_DOWNLOAD_URL -OutFile ".\TE.exe"
- name: Install TestExecute
shell: cmd
run: .\TE.exe -SilentInstall
- name: Download Build Artifact
uses: dawidd6/action-download-artifact@v3
with:
name: DynamoSandbox
workflow: ${{ env.WORKFLOW_RUN_WORKFLOW_ID }}
run_id: ${{ env.WORKFLOW_RUN_ID }}
path: ${{ github.workspace }}\build
- name: Download Pull Request Artifact
uses: dawidd6/action-download-artifact@v3
with:
name: pr_data
workflow: ${{ env.WORKFLOW_RUN_WORKFLOW_ID }}
run_id: ${{ env.WORKFLOW_RUN_ID }}
path: ${{ github.workspace }}\pr
- name: Set Run Details
run: |
"PR_NUMBER=$(Get-Content -Path ${{ github.workspace }}\pr\pr_number.txt)" | Out-File -FilePath $env:GITHUB_ENV -Append
"CHECK_NAME=$("UI Smoke Tests", $($env:WORKFLOW_RUN_NAME -Split " ")[-1] -Join " - ")" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Run UI Smoke Tests
shell: cmd
run: .\utils\run_tests.bat ${{ secrets.TEST_EXECUTE_ACCESS_KEY }} Dynamo\Dynamo.pjs DynamoSandbox SmokeTests ${{ github.workspace }}\build
- name: Publish Test Report
id: test_report
if: always()
uses: dorny/[email protected]
with:
name: ${{ env.CHECK_NAME }}
path: reports/report.xml
reporter: java-junit
- name: Add Test Summary
if: always()
run: |
if (Test-Path -Path reports/summary.md) {
Get-Content -Path reports/summary.md | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
}
- name: Add Run Summary
if: always()
run: |
$run_summary=@"
### Run Summary
Workflow Run: [$env:WORKFLOW_RUN_NAME]($env:WORKFLOW_RUN_HTML_URL)
Check: [$env:CHECK_NAME](${{ steps.test_report.outputs.url_html }})
$(if ($env:PR_NUMBER) {
"Pull Request: [#$env:PR_NUMBER](${{ format('{0}/{1}/pull/{2}', github.server_url, github.repository, env.PR_NUMBER) }})"
})
"@
$run_summary | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
- name: Add Pull Request Comment
if: always()
env:
GH_TOKEN: ${{ github.token }}
run: |
$pr_comment=@"
## UI Smoke Tests
Test: **${{ steps.test_report.outputs.conclusion }}**. ${{ steps.test_report.outputs.passed }} passed, ${{ steps.test_report.outputs.failed }} failed.
[TestComplete Test Result]($(Get-Content -Path ${{ github.workspace }}\reports\result.txt))
Workflow Run: [${{ github.workflow }}](${{ format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }})
Check: [$env:CHECK_NAME](${{ steps.test_report.outputs.url_html }})
"@
if ($env:PR_NUMBER) {
gh pr comment $env:PR_NUMBER --body $pr_comment --repo ${{ github.repository }}
}