-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.04 KB
/
frontend-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Frontend CI
on: pull_request
jobs:
frontend-tests:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:latest
ports:
- 27017:27017
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js for Frontend
uses: actions/setup-node@v2
with:
node-version: 19
- name: Run MongoDB and Wait for Healthy State
run: sleep 10 # Wait for MongoDB container to initialize (adjust timing if needed)
- name: "Start backend"
env:
JWT_SECRET: LJKHGHJYT78CV8676XCYHN
run: |
cd ./api &&
npm install &&
npm run dev &
sleep 10
- name: "Start Frontend"
run: |
cd ./frontend &&
npm install &&
npm run dev &
sleep 10
- name: "Run unit tests"
working-directory: ./frontend
run: npm run unit:once
- name: "Run e2e tests"
working-directory: ./frontend
run: npm run e2e:headless