-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
83 lines (73 loc) · 2.4 KB
/
action.yml
File metadata and controls
83 lines (73 loc) · 2.4 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
81
82
83
name: Run Robot Framework tests
description: 'Runs Robot Framework tests via npm test'
branding:
icon: 'fast-forward'
color: 'purple'
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Load .github/workflows/.env → $GITHUB_ENV
shell: bash
run: |
if [ -f .github/workflows/.env ]; then
grep -vE '^(#|$)' .github/workflows/.env \
| grep -E '^[A-Za-z_][A-Za-z0-9_]*=' \
>> "$GITHUB_ENV"
fi
- name: set WOPEE_SCREENSHOT_VALIDATION_ENABLED if not set as env variable
if: env.WOPEE_SCREENSHOT_VALIDATION_ENABLED == null
shell: bash
run: |
echo 'WOPEE_SCREENSHOT_VALIDATION_ENABLED=true' >> $GITHUB_ENV
- name: Run tests
shell: bash
run: |
python3 -m venv --system-site-packages .venv && \
source .venv/bin/activate && \
pip install -r requirements.txt && \
[ ! -e ".env" ] && cp .github/workflows/.env .env || echo ".env file already exists"
make test
- name: Confirm end of run
if: always()
shell: bash
run: |
ERROR_FLAG=false
if [ "${{ job.status }}" = "failure" ]; then
ERROR_FLAG=true
fi
if [ "${{ github.event.action }}" = "code" ]; then
JSON_PAYLOAD=$(cat <<-EOF
{
"query": "mutation PostProcessAgentSuite(\$input: PostProcessAgentSuiteInput!) { postProcessAgentSuite(input: \$input) }",
"variables": {
"input": {
"error": $ERROR_FLAG,
"projectUuid": "${{ env.WOPEE_PROJECT_UUID }}",
"suiteUuid": "${{ env.WOPEE_SUITE_UUID }}",
"testCase": {
"testCaseId": "${{ env.WOPEE_TEST_CASE_ID }}",
"userStoryId": "${{ env.WOPEE_USER_STORY_ID }}"
}
}
}
}
EOF
)
fi
curl --request POST \
--header 'content-type: application/json' \
--header 'api_key: ${{ env.WOPEE_API_KEY }}' \
--url '${{ env.WOPEE_API_URL }}' \
--data "$JSON_PAYLOAD"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: robot-framework-results
path: |
output.xml
output.json
report.html
log.html
retention-days: 1