-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (114 loc) · 4 KB
/
base-cypress-smoketest.yml
File metadata and controls
126 lines (114 loc) · 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: "Z-BASE Cypress Smoketest: Smoketest shared actions for running"
run-name: "${{ github.event.inputs.build_branch }} | ${{ github.event.inputs.environment }} | ${{ github.event.inputs.sandbox }}"
on:
workflow_call:
inputs:
build_branch:
description: "Branch with smoke tests."
required: true
type: "string"
environment:
description: "Which Environment type are we using"
required: true
type: "string"
sandbox:
description: "Sandbox to run the smoke tests on."
required: true
type: "string"
secrets:
AWS_ASSUME_ROLE:
required: true
CYPRESS_ODSCODE:
required: true
CYPRESS_KEY:
required: true
permissions:
pull-requests: write
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
cypress-run-chrome:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
repository: "NHSDigital/national-document-repository"
ref: ${{ inputs.build_branch}}
- name: AWS Role
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }}
role-skip-session-tagging: true
mask-aws-account-id: true
aws-region: ${{ vars.AWS_REGION }}
- name: Cypress install
run: |
npm install --legacy-peer-deps
working-directory: ./app
- name: Cypress run
uses: cypress-io/github-action@v6
with:
install: false
browser: chrome
working-directory: ./app
spec: |
cypress/e2e/1-ndr-smoke-tests/*.cy.js
cypress/e2e/1-ndr-smoke-tests/**/*.cy.js
env:
CYPRESS_BASE_URL: "https://${{ inputs.sandbox }}.access-request-fulfilment.patient-deductions.nhs.uk"
CYPRESS_grepTags: "smoke"
CYPRESS_WORKSPACE: ${{ inputs.sandbox }}
CYPRESS_ODSCODE: ${{ secrets.CYPRESS_ODSCODE }}
CYPRESS_KEY: ${{ secrets.CYPRESS_KEY }}
CYPRESS_OUTPUT_VIDEO: true
- uses: actions/upload-artifact@v5
if: failure()
with:
name: cypress-screenshots
path: /home/runner/work/national-document-repository/national-document-repository/app/cypress/screenshots
if-no-files-found: ignore
- uses: actions/upload-artifact@v5
if: failure()
with:
name: cypress-videos
path: /home/runner/work/national-document-repository/national-document-repository/app/cypress/videos
if-no-files-found: ignore
cypress-run-edge:
needs: ["cypress-run-chrome"]
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
repository: "NHSDigital/national-document-repository"
ref: ${{ inputs.build_branch}}
- name: AWS Role
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }}
role-skip-session-tagging: true
aws-region: ${{ vars.AWS_REGION }}
mask-aws-account-id: true
- name: Cypress install
run: |
npm install --legacy-peer-deps
working-directory: ./app
- name: Cypress run
uses: cypress-io/github-action@v6
with:
install: false
browser: edge
working-directory: ./app
spec: |
cypress/e2e/1-ndr-smoke-tests/*.cy.js
cypress/e2e/1-ndr-smoke-tests/**/*.cy.js
env:
CYPRESS_BASE_URL: "https://${{ inputs.sandbox }}.access-request-fulfilment.patient-deductions.nhs.uk"
CYPRESS_grepTags: "smoke"
CYPRESS_WORKSPACE: ${{ inputs.sandbox }}
CYPRESS_ODSCODE: ${{ secrets.CYPRESS_ODSCODE }}
CYPRESS_KEY: ${{ secrets.CYPRESS_KEY }}
CYPRESS_OUTPUT_VIDEO: false