-
Notifications
You must be signed in to change notification settings - Fork 51
127 lines (103 loc) · 2.87 KB
/
tests.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Tests
on:
workflow_dispatch:
pull_request:
branches:
- 'develop'
- 'main'
paths-ignore:
- '*.md'
jobs:
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# Prisma
DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}
# Next Auth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: abc
# Next Auth Discord Provider
DISCORD_CLIENT_ID: 123
DISCORD_CLIENT_SECRET: abc
# Next Auth Google Provider
GOOGLE_CLIENT_ID: 123
GOOGLE_CLIENT_SECRET: abc
# Next Auth Facebook provider
FACEBOOK_CLIENT_ID: 123
FACEBOOK_CLIENT_SECRET: abc
# Email Server
EMAIL_SERVER_HOST: host
EMAIL_SERVER_PORT: 1234
EMAIL_SERVER_USER: user
EMAIL_SERVER_PASSWORD: pass
EMAIL_FROM: [email protected]
# DEGREE VALIDATOR
NEXT_PUBLIC_VALIDATOR: http://127.0.0.1:5000
NODE_ENV: test
# UMAMI
NEXT_PUBLIC_UMAMI_URL: hi
NEXT_PUBLIC_UMAMI_WEBSITE_ID: bye
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Start validator server
working-directory: validator
run: |
pip install -r requirements.txt
flask --app api run &
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-replica-set: test-rs
mongodb-version: '6.0'
mongodb-port: 27017
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
npm ci
- name: Run build pipeline
run: npm run build
- name: Start server and run e2e tests
run: |
npm run cypress:run
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
npm ci
- name: Run unit tests with Jest
run: |
npm test -- --silent