-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (98 loc) · 3.29 KB
/
e2e-test-staging.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: End to End Tests on PR Approval - Staging
on:
pull_request_review:
types: [submitted]
pull_request:
types: [labeled]
jobs:
install:
if: (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'run e2e tests')
runs-on: macos-latest
environment: End to End Test - Staging
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'always'
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- 'src/**'
- name: Prepare for end to end tests
if: steps.filter.outputs.src == 'true'
run: npm run setup:env
- name: Cache Dependencies
uses: actions/cache@v3
id: cache
with:
path: |
~/.cache/Cypress
node_modules
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Cypress install
if: steps.filter.outputs.src == 'true' && steps.cache.outputs.cache-hit != 'true'
uses: cypress-io/github-action@v4
with:
install: true
runTests: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
APP_URL: ${{ secrets.APP_URL }}
API_URL: ${{ secrets.API_URL }}
E2E_TESTS_ENV: ${{ secrets.E2E_TESTS_ENV }}
E2E_TESTS_REFRESH_TOKEN: ${{ secrets.E2E_TESTS_REFRESH_TOKEN }}
E2E_TESTS_ORG_ID: ${{ secrets.E2E_TESTS_ORG_ID }}
end-to-end-test:
runs-on: macos-latest
environment: End to End Test - Staging
needs: install
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14
- name: Prepare for end to end tests
run: npm run setup:env
- name: Cache Dependencies
uses: actions/cache@v3
id: cache
with:
path: |
~/.cache/Cypress
node_modules
key: my-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Cypress run
uses: cypress-io/github-action@v4
with:
install: false
record: true
browser: chrome
parallel: true
tag: ${{ secrets.E2E_TESTS_ENV }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
APP_URL: ${{ secrets.APP_URL }}
API_URL: ${{ secrets.API_URL }}
E2E_TESTS_ENV: ${{ secrets.E2E_TESTS_ENV }}
E2E_TESTS_REFRESH_TOKEN: ${{ secrets.E2E_TESTS_REFRESH_TOKEN }}
E2E_TESTS_ORG_ID: ${{ secrets.E2E_TESTS_ORG_ID }}