-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
99 lines (87 loc) · 3.58 KB
/
action.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
97
98
99
name: Trigger Test on TestIO
author: Staffbase GmbH
description: |-
Initiate test on crowd-testing platform TestIO from a pull request with specific comments. Requires TestIO customer account.
inputs:
testio-slug:
description: |-
The slug you received from TestIO.
Usually it is the part inside the URL you got to access your custom area on the TestIO platform according to this pattern: https://<YOUR_SLUG>.test.io
required: true
testio-product-id:
description: |-
On the TestIO platform customers can specify different products.
This property refers to the product you want to trigger a new test for.
required: true
github-token:
description: |-
A GitHub token having granted permissions to write a comment in the repository where this action is intended to be executed.
required: true
testio-token:
description: |-
The token of a TestIO user which should be used for communicating with the TestIO API.
required: true
runs:
using: "composite"
steps:
- name: TestIO - Init global environment
shell: bash
run: |-
echo "TESTIO_SCRIPTS_DIR=${{github.action_path}}" >> $GITHUB_ENV
echo "TESTIO_ERROR_MSG_FILE=errorToComment.msg" >> $GITHUB_ENV
- name: TestIO - Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
- name: TestIO - Install Dependencies
shell: bash
run: |-
cd ${{github.action_path}}
npm install
- name: TestIO - Add PR comment for requesting required input
id: prepare-android
if: startsWith(github.event.comment.body, '@bot-testio exploratory-test create')
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
TESTIO_CREATE_COMMENT_URL: ${{ github.event.comment.html_url }}
TESTIO_CREATE_COMMENT_BODY: ${{ github.event.comment.body }}
shell: bash
run: npx ts-node ${{github.action_path}}/src/addPRcomment.ts
- name: TestIO - Retrieve input and create payload
id: payload
if: startsWith(github.event.comment.body, '@bot-testio exploratory-test submit')
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
TESTIO_SUBMIT_COMMENT_ID: ${{ github.event.comment.id }}
TESTIO_SUBMIT_COMMENT_URL: ${{ github.event.comment.html_url }}
shell: bash
run: npx ts-node ${{github.action_path}}/src/retrievePayload.ts
- name: TestIO - Trigger TestIO Test
id: trigger
if: ${{ steps.payload.outcome == 'success' }}
env:
TESTIO_PRODUCT_ID: ${{ inputs.testio-product-id }}
TESTIO_TOKEN: ${{ inputs.testio-token }}
shell: bash
run: npx ts-node ${{github.action_path}}/src/triggerTest.ts
- name: TestIO - Report Success
if: ${{ steps.trigger.outcome == 'success' }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
TESTIO_CREATED_TEST_ID: ${{ steps.trigger.outputs.testio-created-test-id }}
TESTIO_PRODUCT_ID: ${{ inputs.testio-product-id }}
TESTIO_SLUG: ${{ inputs.testio-slug }}
TESTIO_SUBMIT_COMMENT_ID: ${{ steps.payload.outputs.testio-submit-comment-id }}
TESTIO_CREATE_COMMENT_URL: ${{ steps.payload.outputs.testio-create-comment-url }}
shell: bash
run: npx ts-node ${{github.action_path}}/src/reportSuccess.ts
- name: TestIO - Report Failure
if: failure()
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
TESTIO_CREATE_COMMENT_URL: ${{ steps.payload.outputs.testio-create-comment-url }}
shell: bash
run: npx ts-node ${{github.action_path}}/src/reportFailure.ts
branding:
icon: 'user-plus'
color: 'blue'