Skip to content

Commit

Permalink
Update full-stack-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jipsonminibhavan authored Jan 23, 2024
1 parent 61a3e91 commit 99e6af3
Showing 1 changed file with 17 additions and 47 deletions.
64 changes: 17 additions & 47 deletions .github/workflows/full-stack-tests.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,34 @@
name: Full Stack Tests
name: Run tests

on: [push, pull_request]
on: [push]

jobs:
build-and-test:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.17.1]
mongodb-version: ['7.0.2']
services:
mongodb:
image: mongo:${{ matrix.mongodb-version }}
env:
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
ports:
- 27017:27017
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
node-version: [18.17]
mongodb-version: ['7.0']

steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Git checkout
uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Backend Dependencies
run: |
cd backend
npm install
- name: Initialize Database
run: |
MONGODB_URI=${{ secrets.MONGODB_URI }} npm run initialize-db
- name: Build Backend
run: |
cd backend
npm run build
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: test-rs
mongodb-port: 42069

- name: Start Backend
- name: Install Backend Dependencies
run: |
cd backend
npm run start &
- name: Install Frontend Dependencies
run: |
cd frontend
npm install
- name: Run Frontend Tests
run: |
cd frontend
npm run test:e2e
timeout-minutes: 30

0 comments on commit 99e6af3

Please sign in to comment.