-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
80 lines (75 loc) · 2.97 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
name: 'Improve Sanity Check'
description: 'Check the sanity of improve using improve-selenium project'
inputs:
api-base-url:
description: 'The API base url to run the tests against. Ignored if running against local setup.'
required: true
admin-base-url:
description: 'The admin portal base url to run the tests against. Ignored if running against local setup.'
required: true
app-base-url:
description: 'The application portal base url to run the tests against. Ignored if running against local setup.'
required: true
sanity-secrets:
description: 'All of the secrets needed by selenium project for running test.'
required: true
selenium-image:
description: 'The url for selenium image'
required: true
continue-if-failed:
description: 'If the checks fail, do not break the sequnce'
required: true
default: false
results-path:
description: 'The place to put the test results on'
required: true
default: /tmp/reports
suite:
description: 'The test suite. Default: RunAll.xml'
required: true
default: RunCustom.xml
outputs:
sanity-failed:
value: ${{ steps.sanity-check.outputs.sanity-failed }}
runs:
using: "composite"
steps:
- name: Wait for the API to start up
shell: bash
run: |
echo "Waiting for the API to boot up (if it is recently started)"
for i in {1..60}
do
echo Waiting for a pulse...
curl -sLw "\n" "${{ inputs.api-base-url }}/actuator/health" && IS_UP=1 || IS_UP=0
if [ $IS_UP == 1 ]
then
break
fi
sleep 2
done
test $IS_UP -eq 1 || echo "::error::The API is not running"
test $IS_UP -eq 1
- name: Run sanity-check extension against the required environment
id: sanity-check
shell: bash
run: |
export $(echo "${{ inputs.sanity-secrets }}" | xargs)
rm -rf ${{ inputs.results-path }}
mkdir ${{ inputs.results-path }}
chmod 777 ${{ inputs.results-path }}
export FAILED=0
echo ./build/distributions/improve-selenium-1.0-SNAPSHOT/bin/improve-selenium "suites/${{ inputs.suite }}" -d "${{ inputs.results-path }}"
docker container run -v "${{ inputs.results-path }}":"/tmp/reports" --rm \
--network=host -i ${{ inputs.selenium-image }} \
./build/distributions/improve-selenium-1.0-SNAPSHOT/bin/improve-selenium "suites/${{ inputs.suite }}" -d "${{ inputs.results-path }}" || FAILED=1
echo "::set-output name=sanity-failed::$FAILED"
- name: Break if failed
shell: bash
run: |
test ${{ steps.sanity-check.outputs.sanity-failed }} -eq 0 || echo "Tests failed. Please check the results on ${{ inputs.results-path }}"
if [ ${{ inputs.continue-if-failed }} == false ]
then
test ${{ steps.sanity-check.outputs.sanity-failed }} -eq 0
fi
echo "All tests successfully passed. The resutls are available on ${{ inputs.results-path }}"