forked from linode/manager
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (70 loc) · 2.56 KB
/
e2e_schedule_and_push.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
name: Run Tests On Push/Schedule
concurrency: UI_TESTS
env:
USER_1: ${{ secrets.USER_1 }}
USER_2: ${{ secrets.USER_2 }}
USER_3: ${{ secrets.USER_3 }}
USER_4: ${{ secrets.USER_4 }}
CLIENT_ID: ${{ secrets.REACT_APP_CLIENT_ID }}
CY_TEST_FAIL_ON_MANAGED: 1
on:
schedule:
- cron: "0 13 * * 1-5"
push:
branches:
- develop
- staging
- master
jobs:
run-cypress-e2e:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
user: ["USER_1", "USER_2", "USER_3", "USER_4"]
steps:
- name: install command line utilities
run: sudo apt-get install -y expect
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.17"
- uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- run: |
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- run: echo "MANAGER_OAUTH=$USER_1" >> ./packages/manager/.env
if: matrix['user'] == 'USER_1'
- run: echo "MANAGER_OAUTH=$USER_2" >> ./packages/manager/.env
if: matrix['user'] == 'USER_2'
- run: echo "MANAGER_OAUTH=$USER_3" >> ./packages/manager/.env
if: matrix['user'] == 'USER_3'
- run: echo "MANAGER_OAUTH=$USER_4" >> ./packages/manager/.env
if: matrix['user'] == 'USER_4'
- run: |
echo "REACT_APP_LAUNCH_DARKLY_ID=${{ secrets.REACT_APP_LAUNCH_DARKLY_ID }}" >> ./packages/manager/.env
echo "REACT_APP_CLIENT_ID=$CLIENT_ID" >> ./packages/manager/.env
echo "REACT_APP_LOGIN_ROOT=${{ secrets.REACT_APP_LOGIN_ROOT }}" >> ./packages/manager/.env
echo "REACT_APP_API_ROOT=${{ secrets.REACT_APP_API_ROOT }}" >> ./packages/manager/.env
echo "REACT_APP_APP_ROOT=${{ secrets.REACT_APP_APP_ROOT }}" >> ./packages/manager/.env
echo "REACT_APP_DISABLE_NEW_RELIC=1" >> ./packages/manager/.env
yarn install:all
yarn build
yarn start:manager:ci &
- name: Run tests
uses: cypress-io/github-action@v5
with:
working-directory: packages/manager
wait-on: "http://localhost:3000"
wait-on-timeout: 1000
install: false
browser: chrome
record: true
parallel: true