Skip to content

Commit

Permalink
Merge pull request #605 from UTDNebula/develop
Browse files Browse the repository at this point in the history
Sync with develop
  • Loading branch information
akevinge authored Jul 14, 2023
2 parents 66a1014 + e1808ec commit 3bcc73a
Show file tree
Hide file tree
Showing 43 changed files with 11,063 additions and 6,820 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,27 @@ jobs:
release:
name: Test build app
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
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
with:
mongodb-replica-set: test-rs
mongodb-version: '6.0'
mongodb-port: 27017

- name: Setup Node.js
uses: actions/setup-node@v2
with:
Expand All @@ -37,8 +47,9 @@ jobs:
npm run build
env:
# Prisma
DATABASE_URL: mongodb://localhost:27017/db
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB # This is a dead connection URL - build does not need live DB.

# Next Auth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: abc
Expand Down
57 changes: 48 additions & 9 deletions .github/workflows/e2e-tests.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E tests
name: Tests

on:
workflow_dispatch:
Expand All @@ -9,9 +9,31 @@ on:
- 'master'

jobs:
release:
name: Cypress tests
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
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -32,19 +54,16 @@ jobs:
run: |
npm ci
- name: Prisma generate
- name: Prisma generate and push
run: |
npm run prisma:generate
npm run prisma:generate &&
npx prisma db push
- name: Run Cypress e2e tests
run: |
npm run cypress:run
env:
# Prisma
DATABASE_URL: mongodb://localhost:27017/testing
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}

# Next Auth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: abc
Expand Down Expand Up @@ -77,3 +96,23 @@ jobs:
# UMAMI
NEXT_PUBLIC_UMAMI_URL: hi
NEXT_PUBLIC_UMAMI_WEBSITE_ID: bye

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18

- name: Install dependencies
run: |
npm ci
- name: Run unit tests with Jest
run: |
npm test -- --silent
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
cypress/screenshots
cypress/videos
cypress/downloads
coverage/

# next.js
/.next/
Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Request project lead by default
* @ZzRanger
* @syl15

# Request all Project Nebula Maintainers to review other pull requests
src/**/* @UTDNebula/nebula-planner @UTDNebula/planner
src/**/* @UTDNebula/Planner-Maintainers
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.1'

services:
db:
image: postgres
ports:
- '5432:5432'
environment:
POSTGRES_PASSWORD: postgres
17 changes: 17 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { JestConfigWithTsJest } from 'ts-jest';

const config: JestConfigWithTsJest = {
clearMocks: true,
extensionsToTreatAsEsm: ['.ts'],
coverageProvider: 'v8',
transform: {
'^.+\\.[tj]sx?$': [
'ts-jest',
{
useESM: true,
},
],
},
};

export default config;
Loading

1 comment on commit 3bcc73a

@vercel
Copy link

@vercel vercel bot commented on 3bcc73a Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

planner – ./

planner-git-main-utdnebula.vercel.app
planner-utdnebula.vercel.app
planner.utdnebula.com

Please sign in to comment.