-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
78 lines (78 loc) · 2.37 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
name: 'Schemathesis'
description: 'Run Schemathesis API testing'
author: 'Dmitry Dygalo <@Stranger6667> | Schemathesis.io'
branding:
icon: 'check-square'
color: 'green'
inputs:
schema:
description: 'API schema location'
required: true
base-url:
description: 'Base URL address of the API'
required: false
api-name:
description: 'API name from Schemathesis.io'
required: false
checks:
description: 'List of Schemathesis checks to run. Defaults to `all`'
required: false
default: 'all'
report:
description: "Whether you'd like to see the results in a Web UI in Schemathesis.io"
required: false
default: 'true'
token:
description: 'Your Schemathesis.io token'
required: false
wait-for-schema:
description: 'Maximum time in seconds to wait on the API schema availability'
required: false
default: '2'
max-examples:
description: 'Maximum number of generated examples per each endpoint'
required: false
default: '100'
version:
description: 'Specify which version of Schemathesis should be used. Defaults to `latest`'
required: false
default: "latest"
hooks:
description: 'Schemathesis hooks module'
required: false
args:
description: 'Extra arguments to pass to Schemathesis'
required: false
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: |
pip install --upgrade pip
python3.12 -m venv env
source env/bin/activate
if [ ${{ inputs.version }} == "latest" ] ; then
pip install schemathesis
else
pip install schemathesis==${{ inputs.version }}
fi
shell: bash
- run: |
source env/bin/activate
schemathesis run \
${{ inputs.schema }} \
--hypothesis-database=:memory: \
--hypothesis-max-examples=${{ inputs.max-examples }} \
--checks=${{ inputs.checks }} \
${{ inputs.args }} \
shell: bash
env:
SCHEMATHESIS_BASE_URL: ${{ inputs.base-url }}
SCHEMATHESIS_API_NAME: ${{ inputs.api-name }}
SCHEMATHESIS_REPORT: ${{ inputs.report }}
SCHEMATHESIS_WAIT_FOR_SCHEMA: ${{ inputs.wait-for-schema }}
SCHEMATHESIS_TOKEN: ${{ inputs.token }}
SCHEMATHESIS_HOOKS: ${{ inputs.hooks }}
SCHEMATHESIS_ACTION_REF: ${{ github.action_ref }}