-
-
Notifications
You must be signed in to change notification settings - Fork 55
129 lines (118 loc) · 3.59 KB
/
e2e.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
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
127
128
129
name: Cypress Tests
on:
pull_request:
paths-ignore:
- '.vscode/**'
- 'docs/**'
- 'env/**'
- '**/*.md'
- '.gitpod.yml'
push:
branches:
- master
paths-ignore:
- '.vscode/**'
- 'docs/**'
- 'env/**'
- '**/*.md'
- '.gitpod.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
component:
runs-on: ubuntu-latest
# container:
# image: cypress/browsers:node16.18.0-chrome107-ff106-edge
# options: --user 1001
strategy:
fail-fast: false
matrix:
node-version: [18.x]
# run copies of the current job in parallel
containers: [1, 2]
browsers: [electron]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/Cypress
node_modules
key: cache-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn run cypress install
- name: 'Component Tests'
uses: cypress-io/github-action@v4.2.0
with:
install: false
component: true
record: true
parallel: true
group: 'Component - ${{ matrix.browsers }}'
browser: ${{ matrix.browsers }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
e2e:
runs-on: ubuntu-latest
# container:
# image: cypress/browsers:node16.18.0-chrome107-ff106-edge
# options: --user 1001
strategy:
fail-fast: false
matrix:
node-version: [18.x]
# run copies of the current job in parallel
containers: [1, 2]
browsers: [electron]
env:
# this is safe because it's only used for testing
SESSION_SECRET: LERTmi2Jiz6gJHt21AZUWBstezP41P3odxzEsCo1w4zL8XqGyjGdMZ2QPXUenVQQ2fY1xzGBYseB1g9teRHbxF
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
cache: "yarn"
- run: yarn install --frozen-lockfile
- name: Build client
run: yarn run build
- run: yarn run cypress install
- run: yarn workspace ott-server run sequelize db:migrate
- name: 'E2E Tests'
uses: cypress-io/github-action@v4.2.0
with:
install: false
start: yarn start
wait-on: 'http://localhost:8080/api/status'
wait-on-timeout: 120
browser: ${{ matrix.browsers }}
record: true
parallel: true
group: 'E2E - ${{ matrix.browsers }}'
env:
PORT: 8080
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}