-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 1.43 KB
/
full-stack-tests.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Full Stack Tests
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
mongodb-version: ['4.2', '4.4', '5.0', '6.0']
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
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
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 Backend
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