Skip to content

Commit 170595f

Browse files
authored
Merge pull request #628 from UTDNebula/develop
Sync with develop: validator merge
2 parents 7e0a58e + 273e9f6 commit 170595f

File tree

164 files changed

+28136
-2203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+28136
-2203
lines changed

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Prisma
2+
# In production, DATABASE_URL uses a connection pooler, so we need to separately set DIRECT_DATABASE_URL because Prisma Migrate requires a direct connection to the database.
3+
# DIRECT_DATABASE_URL does not need to be set locally if you are not running database migrations.
4+
# See https://www.prisma.io/docs/guides/performance-and-optimization/connection-management/configure-pg-bouncer#prisma-migrate-and-pgbouncer-workaround for more details
25
DATABASE_URL=
6+
DIRECT_DATABASE_URL=
37
PLATFORM_DATABASE_URL=
8+
49
# Next Auth
510
NEXTAUTH_URL=
611
NEXTAUTH_SECRET=

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = {
1818
'plugin:import/recommended',
1919
'plugin:import/typescript',
2020
'prettier',
21+
'next/core-web-vitals',
2122
],
2223
rules: {
2324
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ on:
66
branches:
77
- 'develop'
88
- 'main'
9+
paths-ignore:
10+
- 'validator/**'
911

1012
jobs:
11-
release:
13+
build:
1214
name: Test build app
1315
runs-on: ubuntu-latest
1416

@@ -33,7 +35,7 @@ jobs:
3335
uses: actions/checkout@v3
3436

3537
- name: Setup Node.js
36-
uses: actions/setup-node@v2
38+
uses: actions/setup-node@v3
3739
with:
3840
node-version: 18
3941

.github/workflows/delete-neon-branch.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ on:
88
pull_request:
99
types:
1010
- closed
11+
paths-ignore:
12+
- 'validator/**'
1113
workflow_dispatch:
1214

1315
jobs:
1416
delete-neon-branch:
1517
permissions: write-all
1618
runs-on: ubuntu-latest
1719
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v3
20-
2120
- name: Search branch by name
2221
id: get_branch_id
2322
# list all branches and filter by name
@@ -29,9 +28,7 @@ jobs:
2928
--header "Authorization: Bearer ${{ secrets.NEON_API_KEY }}" \
3029
| jq -r .branches \
3130
| jq -c '.[] | select(.name | contains("'${{ github.event.pull_request.head.ref || github.head_ref }}'")) .id' \
32-
| jq -r \
33-
) \
34-
31+
| jq -r)
3532
echo "branch_id=${branch_id}" >> $GITHUB_OUTPUT
3633
3734
- name: Delete Neon Branch

.github/workflows/deploy-preview.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: Deploy Preview
22

3-
on:
3+
on:
44
pull_request:
55
branches:
6-
- "develop"
6+
- 'develop'
7+
paths-ignore:
8+
- 'validator/**'
79
workflow_dispatch:
8-
10+
911
env:
1012
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1113
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
@@ -34,11 +36,11 @@ jobs:
3436
- name: Deploy Preview to Vercel
3537
id: deploy
3638
run: |
37-
echo preview_url=$(vercel deploy \
38-
--env DATABASE_URL=${{ steps.create_branch.outputs.db_url_with_pooler}}/neondb \
39-
--build-env DIRECT_DATABASE_URL=${{ steps.create_branch.outputs.db_url}}/neondb \
40-
--public --yes --token=${{ secrets.VERCEL_TOKEN }}) \
41-
>> $GITHUB_OUTPUT
39+
preview_url=$(vercel deploy \
40+
--env DATABASE_URL="${{ steps.create_branch.outputs.db_url_with_pooler}}/neondb?pgbouncer=true&connect_timeout=15&pool_timeout=15" \
41+
--build-env DIRECT_DATABASE_URL="${{ steps.create_branch.outputs.db_url}}/neondb?connect_timeout=10" \
42+
--public --yes --token=${{ secrets.VERCEL_TOKEN }})
43+
echo preview_url=$preview_url >> $GITHUB_OUTPUT
4244
4345
- name: Comment on Pull Request
4446
uses: thollander/actions-comment-pull-request@v2

.github/workflows/format.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
name: Lint
1+
name: Check Formatting
22

33
on:
44
workflow_dispatch:
55
pull_request:
6-
types: [ready_for_review]
6+
paths-ignore:
7+
- 'validator/**'
78

89
jobs:
9-
run-linters:
10-
name: Run linters
10+
eslint:
11+
name: Run ESLint + Prettier
1112
runs-on: ubuntu-latest
1213

1314
steps:
@@ -22,5 +23,11 @@ jobs:
2223
- name: Install Node.js Dependencies
2324
run: npm ci
2425

26+
- name: Generate Prisma Client
27+
run: npm run prisma:generate
28+
29+
- name: Run ESLint
30+
run: npm run lint:check
31+
2532
- name: Run Prettier
2633
run: npm run format:check

.github/workflows/tests.yml

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- 'develop'
88
- 'main'
9+
paths-ignore:
10+
- 'validator/**'
911

1012
jobs:
1113
integration-tests:
@@ -30,10 +32,42 @@ jobs:
3032
3133
env:
3234
# Prisma
33-
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
3435
DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
36+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
3537
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}
3638

39+
# Next Auth
40+
NEXTAUTH_URL: http://localhost:3000
41+
NEXTAUTH_SECRET: abc
42+
43+
# Next Auth Discord Provider
44+
DISCORD_CLIENT_ID: 123
45+
DISCORD_CLIENT_SECRET: abc
46+
47+
# Next Auth Google Provider
48+
GOOGLE_CLIENT_ID: 123
49+
GOOGLE_CLIENT_SECRET: abc
50+
51+
# Next Auth Facebook provider
52+
FACEBOOK_CLIENT_ID: 123
53+
FACEBOOK_CLIENT_SECRET: abc
54+
55+
# Email Server
56+
EMAIL_SERVER_HOST: host
57+
EMAIL_SERVER_PORT: 1234
58+
EMAIL_SERVER_USER: user
59+
EMAIL_SERVER_PASSWORD: pass
60+
EMAIL_FROM: noreply@example.com
61+
62+
# DEGREE VALIDATOR
63+
VALIDATOR: ${{ secrets.VALIDATOR }}
64+
65+
NODE_ENV: test
66+
67+
# UMAMI
68+
NEXT_PUBLIC_UMAMI_URL: hi
69+
NEXT_PUBLIC_UMAMI_WEBSITE_ID: bye
70+
3771
steps:
3872
- name: Checkout
3973
uses: actions/checkout@v3
@@ -46,57 +80,21 @@ jobs:
4680
mongodb-port: 27017
4781

4882
- name: Setup Node.js
49-
uses: actions/setup-node@v2
83+
uses: actions/setup-node@v3
5084
with:
5185
node-version: 18
5286

5387
- name: Install dependencies
5488
run: |
5589
npm ci
5690
57-
- name: Prisma generate and push
58-
run: |
59-
npm run prisma:generate &&
60-
npm run prisma:migrate:deploy
91+
- name: Run build pipeline
92+
run: npm run build
6193

62-
- name: Run Cypress e2e tests
94+
- name: Start server and run e2e tests
6395
run: |
6496
npm run cypress:run
6597
66-
env:
67-
# Next Auth
68-
NEXTAUTH_URL: http://localhost:3000
69-
NEXTAUTH_SECRET: abc
70-
71-
# Next Auth Discord Provider
72-
DISCORD_CLIENT_ID: 123
73-
DISCORD_CLIENT_SECRET: abc
74-
75-
# Next Auth Google Provider
76-
GOOGLE_CLIENT_ID: 123
77-
GOOGLE_CLIENT_SECRET: abc
78-
79-
# Next Auth Facebook provider
80-
FACEBOOK_CLIENT_ID: 123
81-
FACEBOOK_CLIENT_SECRET: abc
82-
83-
# Email Server
84-
EMAIL_SERVER_HOST: host
85-
EMAIL_SERVER_PORT: 1234
86-
EMAIL_SERVER_USER: user
87-
EMAIL_SERVER_PASSWORD: pass
88-
EMAIL_FROM: noreply@example.com
89-
90-
# DEGREE VALIDATOR
91-
VALIDATOR: ${{ secrets.VALIDATOR }}
92-
93-
NODE_ENV: test
94-
VERCEL_ENV: preview
95-
96-
# UMAMI
97-
NEXT_PUBLIC_UMAMI_URL: hi
98-
NEXT_PUBLIC_UMAMI_WEBSITE_ID: bye
99-
10098
unit-tests:
10199
name: Unit tests
102100
runs-on: ubuntu-latest
@@ -105,7 +103,7 @@ jobs:
105103
uses: actions/checkout@v3
106104

107105
- name: Setup Node.js
108-
uses: actions/setup-node@v2
106+
uses: actions/setup-node@v3
109107
with:
110108
node-version: 18
111109

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build Validator
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- 'validator/**'
8+
9+
jobs:
10+
release:
11+
name: Test validator
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: validator
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install dependencies
25+
run: |
26+
pip3 install -r requirements.txt
27+
28+
- name: Run tests
29+
run: |
30+
pytest --verbose
31+
32+
- name: Run type checker
33+
run: |
34+
mypy .

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ yarn-error.log*
4545
# Don't want IDE/code editor files in this repository
4646
# See docs/ide-config.md for more information.
4747
.idea
48-
.vscode
4948
.vs/
5049

5150
prisma/generated

.vercelignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
validator/
2+
tests/
3+
cypress/
4+
cypress.config.ts
5+
.github/
6+
.vscode/

0 commit comments

Comments
 (0)