-
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (82 loc) · 3.6 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
81
82
83
84
85
86
87
88
89
90
91
name: Cypress Tests
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
# Runs tests in parallel with matrix strategy https://docs.cypress.io/guides/guides/parallelization
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
# Also see warning here https://github.com/cypress-io/github-action#parallel
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
matrix:
containers: [1, 2] # Uses 2 parallel instances
steps:
- name: Test postgres connection
run: psql postgres://postgres:postgres@localhost:5432/postgres -c 'SELECT 1;'
- name: Create additional database
run: psql postgres://postgres:postgres@localhost:5432/postgres -c 'create database saashq;'
- name: Checkout
uses: actions/checkout@v3
- name: Prisma Schema Validate
uses: elijaholmos/prisma-schema-validate@v1.0.0
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Prisma Generate and Push
run: |
npx prisma generate
npx prisma db push
npx prisma db seed
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
build: npm run build
start: npm start
wait-on: "http://localhost:3000" # Waits for above
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: false
parallel: false # Runs test in parallel using settings above
env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
DO_ENDPOINT: ${{ secrets.DO_ENDPOINT }}
DO_REGION: ${{ secrets.DO_REGION }}
DO_ACCESS_KEY_ID: ${{ secrets.DO_ACCESS_KEY_ID }}
DO_ACCESS_KEY_SECRET: ${{ secrets.DO_ACCESS_KEY_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
JWT_SECRET: ${{ secrets.JWT_SECRET }}
SAASHQ_TOKEN: ${{ secrets.SAASHQ_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
NEXT_PUBLIC_APP_NAME: ${{ secrets.NEXT_PUBLIC_APP_NAME }}
NEXT_PUBLIC_APP_V: ${{ secrets.NEXT_PUBLIC_APP_V }}
NEXT_PUBLIC_APP_URL: ${{ secrets.NEXT_PUBLIC_APP_URL }}
UPLOADTHING_SECRET: ${{ secrets.UPLOADTHING_SECRET }}