-
Notifications
You must be signed in to change notification settings - Fork 8
63 lines (56 loc) · 2.68 KB
/
main.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI with Xray server/DC
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
BROWSER: firefox
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Export scenarios from Xray and generate .feature file(s)
run: |
FEATURES_FILE=features.zip
rm -f $FEATURES_FILE
curl -u ${{ secrets.JIRASERVER_USERNAME }}:${{ secrets.JIRASERVER_PASSWORD }} "${{ secrets.JIRASERVER_BASE_URL }}/rest/raven/2.0/export/test?keys=${{ secrets.XRAYSERVER_ISSUE_KEYS_TO_EXPORT_FROM }}&fz=true" -o $FEATURES_FILE
rm -f features/*.feature
unzip -o $FEATURES_FILE -d features
- name: Run Cypress tests
uses: cypress-io/github-action@v4
continue-on-error: true
with:
# Specify Browser; container image has Firefox
browser: ${{ env.BROWSER }}
spec: features/**/*.feature
- name: generate auxiliary file to define fields on the Test Execution
run: |
cat testexec_template.json | sed s/PROJECT_KEY/${{ secrets.JIRASERVER_PROJECT_KEY }}/g | sed s/CF_TEST_ENVIRONMENT/${{ secrets.JIRASERVER_CF_TEST_ENVIRONMENTS }}/g | sed s/TEST_ENVIRONMENT_NAME/${{ env.BROWSER }}/g | sed s/CF_TEST_PLAN/${{ secrets.JIRASERVER_CF_TEST_PLAN }}/g | sed s/TESTPLAN_KEY/${{ secrets.XRAYSERVER_TEST_PLAN_KEY }}/g > test_exec.json
- name: debug testexec json
run: |
cat test_exec.json
- name: "Import results to Xray (server/DC) using multipart endpoint"
run: |
curl -X POST -u ${{ secrets.JIRASERVER_USERNAME }}:${{ secrets.JIRASERVER_PASSWORD }} -F info=@test_exec.json -F result=@"cucumber-report.json" ${{ secrets.JIRASERVER_BASE_URL }}/rest/raven/2.0/import/execution/cucumber/multipart
- name: "Import results to Xray using GH action"
uses: mikepenz/[email protected]
with:
username: ${{ secrets.JIRASERVER_USERNAME }}
password: ${{ secrets.JIRASERVER_PASSWORD }}
xrayCloud: "false"
xrayBaseUrl: ${{ secrets.JIRASERVER_BASE_URL }}
testFormat: "cucumber"
testPaths: "cucumber-report.json"
testExecutionJson: "test_exec.json"