-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (114 loc) · 3.58 KB
/
Copy pathci-cd.yml
File metadata and controls
136 lines (114 loc) · 3.58 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run linting
run: |
pip install black isort flake8
black --check backend/ common/ tests/
isort --check-only backend/ common/ tests/
flake8 backend/ common/ tests/ --max-line-length=120
- name: Run unit tests
run: |
pytest tests/unit/ -v --cov=backend --cov=common --cov-report=xml --cov-report=term-missing
- name: Run integration tests
run: |
pytest tests/integration/ -v --no-cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
build:
name: Build Docker Images
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push user-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/user-service.Dockerfile
push: true
tags: zenenglish/user-service:latest
- name: Build and push question-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/question-service.Dockerfile
push: true
tags: zenenglish/question-service:latest
- name: Build and push practice-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/practice-service.Dockerfile
push: true
tags: zenenglish/practice-service:latest
- name: Build and push scoring-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/scoring-service.Dockerfile
push: true
tags: zenenglish/scoring-service:latest
- name: Build and push asr-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/asr-service.Dockerfile
push: true
tags: zenenglish/asr-service:latest
- name: Build and push tts-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/tts-service.Dockerfile
push: true
tags: zenenglish/tts-service:latest
- name: Build and push llm-service
uses: docker/build-push-action@v5
with:
context: .
file: deploy/docker/llm-service.Dockerfile
push: true
tags: zenenglish/llm-service:latest