-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (138 loc) · 4.55 KB
/
production-scheduled-tests.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Production scheduled tests
on:
schedule:
- cron: '30 */6 * * *'
concurrency: production_environment
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set Node version
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: yarn
- name: Restore Node modules
id: node-modules
uses: actions/[email protected]
with:
path: |
./node_modules
./applications/*/*/node_modules
./packages/*/node_modules
key: ${{ runner.os }}-modules-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-
- name: Restore cache
id: cache
uses: actions/[email protected]
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cache-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Install dependencies
if: steps.node-modules.outputs.cache-hit != 'true' || steps.cache.outputs.cache-hit != 'true'
run: yarn
warm-up:
name: Warm up
runs-on: ubuntu-latest
needs:
- setup
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_ACCOUNTS_BACKEND }}
STAGE: production
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set Node version
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: yarn
- name: Generate packages cache key
run: ./scripts/checksum.sh ./packages.txt packages
- name: Restore Node modules
uses: actions/[email protected]
with:
path: |
./node_modules
./applications/*/*/node_modules
./packages/*/node_modules
key: ${{ runner.os }}-modules-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-
- name: Restore packages
uses: actions/[email protected]
with:
path: ./packages/*/lib
key: ${{ runner.os }}-packages-v4-${{ hashFiles('**/packages.txt') }}
restore-keys: |
${{ runner.os }}-packages-
- name: Restore application cache
uses: actions/[email protected]
with:
path: |
./applications/accounts/warm-up/node_modules/.cache
./applications/accounts/warm-up/.serverless
key: ${{ runner.os }}-accounts-warm-up-v4-${{ github.sha }}
restore-keys: |
${{ runner.os }}-accounts-warm-up-v4-
- name: Warm up
run: yarn workspace @accounts/warm-up start --stage $STAGE
accounts-tests:
name: Accounts tests
runs-on: ubuntu-latest
needs: warm-up
strategy:
fail-fast: false
matrix:
containers:
- 1
- 2
env:
CURRENTS_API_URL: ${{ secrets.CYPRESS_API_URL }}
CURRENTS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_BASE_URL: https://accounts.motechdevelopment.co.uk
CYPRESS_AUDIENCE: ${{ secrets.ACCOUNTS_APP_AUDIENCE }}
CYPRESS_AUTH_URL: ${{ secrets.CYPRESS_AUTH_URL_PROD }}
CYPRESS_CLIENT_ID: ${{ secrets.ACCOUNTS_APP_CLIENT_ID_PROD }}
CYPRESS_PASSWORD: ${{ secrets.CYPRESS_PASSWORD }}
CYPRESS_USERNAME: ${{ secrets.CYPRESS_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set Node version
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: yarn
- name: Restore Node modules
uses: actions/[email protected]
with:
path: |
./node_modules
./applications/*/*/node_modules
./packages/*/node_modules
key: ${{ runner.os }}-modules-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-
- name: Restore cache
uses: actions/[email protected]
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cache-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Smoke tests
uses: cypress-io/[email protected]
with:
command: yarn workspace @accounts/client e2e-ci
install: false