Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aya UI, backend, and analytics app #1

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# What does this PR do?

<!-- delete this line and add details -->

## Where are the changes made?

- [ ] Frontend
- [ ] Backend
- [ ] Misc (ops scripts, actions, analytics, etc)

## Related Issue(s)

<!-- delete this line and add issues -->

## Screenshots (for UI changes)

<!-- delete this line and add mobile and desktop screenshots for UI changes -->

## These changes have been tested:

- [ ] Manually
- [ ] Via automated tests
- [ ] Both
34 changes: 34 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ESLint

on:
push:
branches:
- main
paths:
- frontend/
pull_request:
branches:
- main
paths:
- frontend/**

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 19

- name: Install dependencies
run: npm ci
working-directory: frontend

- name: Run ESLint
run: npm run lint
working-directory: frontend
38 changes: 38 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lighthouse

on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- 'frontend/**'

jobs:
lighthouse:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Install dependencies
run: npm ci
working-directory: frontend

- name: Build frontend
run: CI=false npm run build
working-directory: frontend

- name: Run Lighthouse CI
run: |
npm install -g @lhci/cli
lhci autorun
working-directory: frontend
66 changes: 66 additions & 0 deletions .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Backend unit tests

on:
push:
branches: [ "staging", "production"]
pull_request:
paths:
- backend/**
- docker/Dockerfile.postgres

defaults:
run:
working-directory: ./backend

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:14
env:
POSTGRES_USER: backendapp
POSTGRES_PASSWORD: password
POSTGRES_DB: instruct_multilingual
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 2

steps:
- uses: actions/checkout@v3

- name: build and run postgres docker container
uses: docker/build-push-action@v2
with:
context: ./docker/
file: ./docker/Dockerfile.postgres
push: false
tags: database:latest

- name: set up python 3.10
id: pythonsetup
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: install dependencies
if: steps.pythonsetup.outcome == 'success'
id: dependencies
run: |
pip install -U pip
pip install poetry
poetry install --with dev

- name: run pytest unit tests
if: steps.dependencies.outcome == 'success'
run: |
ENVIRONMENT=test poetry run pytest
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: NPM Tests

on:
push:
branches:
- main
paths:
- frontend/
pull_request:
branches:
- main
paths:
- frontend/**

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Install dependencies
run: npm ci
working-directory: frontend

- name: Run tests
run: npm test
working-directory: frontend
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.csv
*.ipynb_checkpoints/

# python auto generated files
*__pycache__
*.pyc
*.pyo

# env files
.env
*.env.local
*.env.staging*
*.env.prod*
*.env.team-instruct-multilingual-app.prod
*.env.analytics-instruct-multilingual-app.prod
.python-version

# Project
discord_credentials.json

# ssl connections files
*.pem

# Coverage reports
coverage

# Lighthouse
.lighthouseci
Loading
Loading