90 lines (79 loc) · 3.11 KB
/
cypress-canary.yaml
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
name: Cypress E2E Testing of Deployed React Adobe Embed Component as a Heartbeat Canary
on:
repository_dispatch:
types: [react_adobe_embed_code_pushed]
push:
branches: [main]
schedule:
- cron: '*/12 13-23 * * *'
- cron: '*/12 0-5 * * *'
jobs:
install:
runs-on: ubuntu-latest
container: cypress/browsers:node18.6.0-chrome105-ff104
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress install
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
# Disable running of tests within install job
runTests: false
build: npm install
config-file: "cypress.config.ts"
cypress-runner-verify:
name: Cypress Runner that runs a single test suite which verifies the accessed page is with the latest deployed code
runs-on: ubuntu-latest
container: cypress/browsers:node18.6.0-chrome105-ff104
needs: install
environment: canary-continous-deployment
if: github.event_name == 'repository_dispatch'
steps:
- name: Checkout test code
uses: actions/checkout@v2
- name: Install dependencies required for Cypress"
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
config-file: "cypress.config.ts"
runTests: false
- name: Run Verify Test Suite
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
install: false # Explicit due to having done so in a different step
record: true
spec: cypress/e2e/push.*.ts
config-file: "cypress.config.ts"
browser: chrome
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
REACT_ADOBE_EMBED_API_KEY: ${{ secrets.REACT_ADOBE_EMBED_API_KEY }}
DATEMODIFIED_CODE_DEPLOYED: ${{ github.event.client_payload.message.DATEMODIFIED_CODE_DEPLOYED }}
cypress-runner:
name: Cypress Runner for completing a run of all tests
runs-on: ubuntu-latest
container: cypress/browsers:node18.6.0-chrome105-ff104
needs: install
environment: canary-continous-deployment
steps:
- name: Checkout test code
uses: actions/checkout@v2
- name : Install dependencies required for Cypress"
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
config-file: "cypress.config.ts"
runTests: false
- name: Run Cypress tests
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
install: false # Explicit due to having done so in a different step
record: false
spec: |
cypress/e2e/base.*.ts
cypress/e2e/lightbox.*.ts
config-file: "cypress.config.ts"
browser: chrome
env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
REACT_ADOBE_EMBED_API_KEY: ${{ secrets.REACT_ADOBE_EMBED_API_KEY }}