-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
82 lines (75 loc) · 2.75 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
81
82
name: 'Run PR included Cypress tests on Currents dev'
description: 'Runs Cypress PR included end-to-end test on Currents dev platform'
inputs:
github_token:
description: 'Github token'
required: false
url:
description: "Name of the test url (dev, staging, prod, custom)"
required: true
default: staging
customUrl:
description: "Url of custom env (PR deploy, dev/prod env)"
required: false
base_ref:
description: "Target branch of Pull Request"
required: true
head_ref:
description: "Branch of Pull Request"
required: true
ref:
description: "`ref` param for actions/checkout"
required: true
secret_name:
description: "Name of the secret in aws secret manager"
required: true
runs:
using: "composite"
steps:
- name: Show action's inputs
shell: bash
run: |
echo "github_token=${{ inputs.github_token }}"
echo "url=${{ inputs.url }}"
echo "customUrl=${{ inputs.customUrl }}"
echo "base_ref=${{ inputs.base_ref }}"
echo "head_ref=${{ inputs.head_ref }}"
echo "ref=${{ inputs.ref }}"
- name: Checkout
uses: actions/checkout@v3
with:
repository: 'Bowery-RES/webapp-ui-automation'
token: ${{ inputs.github_token }}
ref: ${{ inputs.ref }}
- name: Installing modules
uses: bahmutov/[email protected]
- name: Install Currents globally
run: npm i @currents/cli -g
shell: bash
- name: Define included specs
id: define_specs
shell: bash
run: |
git fetch --no-tags --depth=1 origin ${{ inputs.base_ref }}
git fetch --no-tags --depth=1 origin ${{ inputs.head_ref }}
git checkout origin/${{ inputs.base_ref }}
git checkout origin/${{ inputs.head_ref }}
git checkout ${{ inputs.ref }}
CHANGED_SPECS=$(npx find-cypress-specs --branch ${{ inputs.base_ref }})
echo ::set-output name=CHANGED_SPECS::$CHANGED_SPECS
- name: Set secrets to GH environment
if: ${{ !env.ACT }}
uses: Bowery-RES/[email protected]
with:
secrets: |
${{ inputs.secret_name }}
namespace: false
- name: Run included specs
run: currents run --config-file cypress.config.ts --tag ${{ inputs.url }} --spec ${{ steps.define_specs.outputs.CHANGED_SPECS }} --browser chrome --record --parallel --key ${{ env.CYPRESS_CURRENTS_RECORD_KEY }} --ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.job }}-${{ github.run_attempt}}"
shell: bash
env:
CYPRESS_url: ${{ inputs.url }}
CYPRESS_customUrl: ${{ inputs.customUrl == '' && '' || inputs.customUrl }}
DD_CIVISIBILITY_AGENTLESS_ENABLED: 'true'
DD_ENV: ${{ inputs.url }}
DD_SERVICE: 'webapp'