initializeDB out of constructor #55
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
name: Run tests | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MONGODB_URI: mongodb://localhost:42069/suryia | |
strategy: | |
matrix: | |
node-version: [18.17] | |
mongodb-version: ['7.0'] | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Start MongoDB | |
uses: supercharge/[email protected] | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
mongodb-replica-set: test-rs | |
mongodb-port: 42069 | |
- name: Install Backend Dependencies | |
run: | | |
cd backend | |
npm install | |
- name: Build Backend | |
run: | | |
cd backend | |
npm run build | |
- name: Initialize Database | |
run: | | |
cd backend | |
npm run initialize-db | |
- name: Start API | |
run: | | |
cd backend | |
npm start & | |
# Frontend | |
- name: Install Frontend Dependencies | |
run: | | |
cd frontend | |
npm install | |
- name: Build Frontend (if necessary) | |
run: | | |
cd frontend | |
npm run build | |
- name: Start Frontend in Background | |
run: | | |
cd frontend | |
npm run preview & | |
# E2E Tests | |
- name: Run E2E tests | |
run: | | |
cd frontend | |
npm run test:e2e |