Merge pull request #147 from AarshShah9/James/chat-system-cleanup #501
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: backend/package-lock.json | |
# Change directory to backend before running npm commands | |
- run: | | |
cd backend | |
touch .env | |
echo IP_ADDRESS=localhost >> .env | |
echo DATABASE_URL=$DATABASE_URL >> .env | |
echo AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID >> .env | |
echo AWS_SECRET_ACCESS_KEY=$DATABASE_URL >> .env | |
echo AWS_REGION=$AWS_REGION >> .env | |
echo AWS_BUCKET_NAME=$AWS_BUCKET_NAME >> .env | |
echo PORT=3000 >> .env | |
echo ENV=GA >> .env | |
echo NGROK_AUTHTOKEN=NA >> .env | |
echo URL=NA >> .env | |
echo JWT_SECRET=NA >> .env | |
echo MAILER_EMAIL=NA >> .env | |
echo MAILER_PASS=NA >> .env | |
echo GOOGLE_MAPS_API_KEY=NA >> .env | |
echo EXPO_ACCESS_TOKEN=NA >> .env | |
echo GPT_KEY=NA >> .env | |
echo GPT_ORG=NA >> .env | |
echo GOOGLE_SERVICE_ACCOUNT_KEY=${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }} >> .env | |
echo SENDGRID_API_KEY=NA >> .env | |
echo SENDGRID_EMAIL=NA >> .env | |
- name: Install Root Dependencies | |
run: npm ci | |
- name: Install Backend Dependencies | |
run: cd backend && npm ci | |
- name: Build Backend (if applicable) | |
run: cd backend && npm run build --if-present | |
- name: Test Backend | |
run: cd backend && npm test |