forked from benhamiltonpro/cypress-testrail-simple-nx
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 2.29 KB
/
cases.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
# starts a new TestRail run but with test cases from some specs only
name: cases
on: [push]
jobs:
tests:
runs-on: ubuntu-20.04
env:
# pass TestRail settings from the project secrets
# via environment variables
TESTRAIL_HOST: ${{secrets.TESTRAIL_HOST}}
TESTRAIL_USERNAME: ${{secrets.TESTRAIL_USERNAME}}
TESTRAIL_PASSWORD: ${{secrets.TESTRAIL_PASSWORD}}
# the project ID is not that secret
TESTRAIL_PROJECTID: 1
# for debugging the scripts in this package
DEBUG: cypress-testrail-simple
steps:
- name: Checkout 🛎
uses: actions/checkout@v2
# Install NPM dependencies, cache them correctly
- name: Install 📦
uses: cypress-io/github-action@v2
with:
runTests: false
# you can pass GitHub information in the name and description
# to include in the TestRail run information
# https://docs.github.com/en/actions/learn-github-actions/contexts
- name: Start TestRail Run 🏃🏻♂️
id: testRail
run: |
commitSubject="${{ github.event.commits[0].message }}"
runName="Testing cases on GitHub Actions: ${commitSubject}"
runDescription="Cypress tests for commit ${GITHUB_SHA} ${GITHUB_REF}"
echo ${commitSubject}
echo ${runName}
echo ${runDescription}
runId=$(node ./bin/testrail-start-run.js \
--spec 'cypress/integration/spec-b.js' \
--name "${runName}" \
--description "${runDescription}")
echo "TestRail run id ${runId}"
# save the run ID as the output from this step
echo "::set-output name=runId::${runId}"
- name: Cypress tests 🧪
uses: cypress-io/github-action@v2
with:
install-command: echo "Already installed"
record: true
group: Cases GitHub Actions
spec: 'cypress/integration/spec-b.js'
env:
TESTRAIL_RUN_ID: ${{ steps.testRail.outputs.runId }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Close TestRail Run 🏁
# always close the test run, even if the previous steps have failed
if: ${{ always() }}
run: |
node ./bin/testrail-close-run.js ${{ steps.testRail.outputs.runId }}