-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (63 loc) · 2.1 KB
/
main.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
name: End-to-end tests
on: push
jobs:
install:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache node modules and .next cache
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Cypress install
uses: cypress-io/github-action@v6
with:
runTests: false
build: npm run build
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Save .next folder
uses: actions/upload-artifact@v4
with:
name: next-artifact
if-no-files-found: error
path: .next
cypress-run:
runs-on: ubuntu-22.04
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download the .next folder
uses: actions/download-artifact@v4
with:
name: next-artifact
path: .next
- name: Cache node modules and .next cache
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: npm run start
browser: electron
record: true
env:
TZ: "America/Denver"
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
POSTGRES_URL: ${{ secrets.POSTGRES_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}