-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
80 lines (76 loc) · 2.83 KB
/
Copy pathaction.yml
File metadata and controls
80 lines (76 loc) · 2.83 KB
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
name: "SmoothQA Run Tests"
description: "Trigger SmoothQA test suite runs from your CI/CD pipeline and get pass/fail results"
branding:
icon: "check-circle"
color: "purple"
inputs:
api_key:
description: "SmoothQA Pipeline API key (starts with sqpk_)"
required: true
base_url:
description: "Base URL of your SmoothQA instance (e.g. https://your-instance.example.com)"
required: true
suite_ids:
description: "Comma-separated list of test suite IDs to run (max 10)"
required: true
timeout_ms:
description: "Total timeout in milliseconds (default: 600000, range: 30000–1800000)"
required: false
default: "600000"
include_details:
description: "Include individual test case results in the output (true/false)"
required: false
default: "false"
comment_on_pr:
description: "Post a summary comment on the pull request (true/false)"
required: false
default: "true"
github_token:
description: "GitHub token for posting PR comments (defaults to github.token)"
required: false
default: "${{ github.token }}"
fail_on_test_failure:
description: "Fail the action if any test suite fails (true/false)"
required: false
default: "true"
outputs:
overall_status:
description: "Overall test status: PASSED or FAILED"
value: ${{ steps.run-tests.outputs.overall_status }}
total_suites:
description: "Total number of suites that were run"
value: ${{ steps.run-tests.outputs.total_suites }}
passed_suites:
description: "Number of suites that passed"
value: ${{ steps.run-tests.outputs.passed_suites }}
failed_suites:
description: "Number of suites that failed"
value: ${{ steps.run-tests.outputs.failed_suites }}
total_duration_ms:
description: "Total duration across all suites in milliseconds"
value: ${{ steps.run-tests.outputs.total_duration_ms }}
result_json:
description: "Full JSON response from the SmoothQA API"
value: ${{ steps.run-tests.outputs.result_json }}
runs:
using: "composite"
steps:
- name: Run SmoothQA tests
id: run-tests
shell: bash
env:
SMOOTHQA_API_KEY: ${{ inputs.api_key }}
SMOOTHQA_BASE_URL: ${{ inputs.base_url }}
SMOOTHQA_SUITE_IDS: ${{ inputs.suite_ids }}
SMOOTHQA_TIMEOUT_MS: ${{ inputs.timeout_ms }}
SMOOTHQA_INCLUDE_DETAILS: ${{ inputs.include_details }}
SMOOTHQA_FAIL_ON_FAILURE: ${{ inputs.fail_on_test_failure }}
run: bash "${{ github.action_path }}/run-tests.sh"
- name: Post PR comment
if: inputs.comment_on_pr == 'true' && github.event_name == 'pull_request'
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
SMOOTHQA_RESULT_JSON: ${{ steps.run-tests.outputs.result_json }}
SMOOTHQA_BASE_URL: ${{ inputs.base_url }}
run: bash "${{ github.action_path }}/post-comment.sh"