-
Notifications
You must be signed in to change notification settings - Fork 10
74 lines (57 loc) · 1.61 KB
/
Copy pathci-cd.yml
File metadata and controls
74 lines (57 loc) · 1.61 KB
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
65
66
67
68
69
70
71
72
73
74
name: CI/CD Pipeline
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
backend-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest httpx coverage
- name: Run Code Quality Checks
run: |
flake8 app tests
isort --check-only app tests
- name: Run Backend Tests
run: |
pytest --cov=app --cov-report=term-missing tests/
frontend-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies
run: npm install
- name: Run Frontend Tests
run: npx vitest run
- name: Build Frontend
run: npm run build
docker-build:
needs: [backend-test, frontend-test]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Build Backend Docker Image
run: docker build ./backend -t medigenius-backend:latest
- name: Build Frontend Docker Image
run: docker build ./frontend -t medigenius-frontend:latest