-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.04 KB
/
Copy pathmain.yml
File metadata and controls
77 lines (65 loc) · 2.04 KB
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
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: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: TypeScript type check
run: npm run lint:ts
- name: Build Next.js app
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: npm run build
- name: Cypress install
uses: cypress-io/github-action@v6
with:
runTests: false
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
cypress-run:
runs-on: ubuntu-22.04
needs: install
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: npm ci
- name: Build Next.js app
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: npm run build
- name: Verify .next contents before starting
run: ls -la .next
- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: npm run start
browser: chrome
env:
TZ: 'America/Denver'
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
POSTGRES_URL: ${{ secrets.POSTGRES_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}