Repository navigation
83 lines (73 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
83 lines (73 loc) · 2.39 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
name: CI
on:
push:
branches: [ "master", "pre-release" ]
pull_request:
branches: [ "master", "pre-release" ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.10", "3.12"]
fail-fast: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Match Dockerfile dependencies
- name: Install Dependencies
run: |
sudo rm -f /etc/apt/sources.list.d/google-chrome*
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
espeak-ng \
espeak-ng-data \
git \
libsndfile1 \
curl \
ffmpeg \
g++ \
cmake
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Cache model weights
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: api/src/models/v1_0
key: kokoro-model-${{ hashFiles('docker/scripts/download_model.py') }}
- name: Download model
run: python3 docker/scripts/download_model.py --output api/src/models/v1_0
- name: Run Tests
run: |
uv run --extra test --extra cpu pytest api/tests/ --asyncio-mode=auto --cov=api --cov-report=term-missing --cov-report=xml
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
web:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: npm
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
run: |
npm ci
sudo rm -f /etc/apt/sources.list.d/google-chrome*
npx playwright install --with-deps chromium
- name: Run Unit Tests
run: npm run test:web
- name: Run E2E Tests
run: npm run test:e2e