-
Notifications
You must be signed in to change notification settings - Fork 430
80 lines (70 loc) · 2.32 KB
/
cypress.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
name: Cypress E2E Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '*/30 * * * *' # Runs every 30 minutes
pull_request:
branches:
- main
- dev
paths:
- '.github/**'
- 'sweepai/**'
- 'sweep_chat/**'
- pyproject.toml
- requirements.txt
jobs:
cypress:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache node modules
id: cache-node-modules
uses: actions/cache/restore@v4
with:
path: |
~/.npm
~/.cache/Cypress
sweep_chat/node_modules
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Install npm dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
working-directory: sweep_chat
run: npm ci
- name: Cache save node modules
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: |
~/.npm
~/.cache/Cypress
sweep_chat/node_modules
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Cache build
id: cache-build
uses: actions/cache/restore@v4
with:
path: sweep_chat/.next
key: ${{ runner.os }}-${{ hashFiles('sweep_chat/components/*.tsx', 'sweep_chat/app/*.tsx', 'sweep_chat/app/*.ts', 'sweep_chat/lib/*.ts') }}
- name: Build next.js
if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
working-directory: sweep_chat
run: |
export BACKEND_URL=${{ secrets.BACKEND_URL }}
npm run build
- name: Cache build
if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: sweep_chat/.next
key: ${{ runner.os }}-${{ hashFiles('sweep_chat/components/*.tsx', 'sweep_chat/app/*.tsx', 'sweep_chat/app/*.ts', 'sweep_chat/lib/*.ts') }}
- name: Run Cypress tests
working-directory: sweep_chat
run: |
echo "${{ secrets.CYPRESS_ENV_LOCAL }}" > .env.local
echo "\nBACKEND_URL=${{ secrets.BACKEND_URL }}" >> env.local
export CYPRESS_LOGIN_SESSION_COOKIE=${{ secrets.CYPRESS_LOGIN_SESSION_COOKIE }}
npm run e2e:ci