-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yml
More file actions
59 lines (47 loc) · 1.44 KB
/
Copy pathmain.yml
File metadata and controls
59 lines (47 loc) · 1.44 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
name: FastAPI CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.10'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg espeak-ng
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install flake8 pytest pytest-asyncio
- name: Generate test audio
run: |
ffmpeg -f lavfi -i anullsrc=r=16000:cl=mono -t 1 -y test.wav
- name: Run tests
run: |
pytest
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Deploy to Server
if: github.ref == 'refs/heads/main'
run: |
echo "Deployment step (e.g., SCP, Rsync)"
- name: Notify Deployment Success
if: success()
run: echo "Deployment succeeded!"
- name: Notify Deployment Failure
if: failure()
run: echo "Deployment failed!"