-
Notifications
You must be signed in to change notification settings - Fork 112
92 lines (74 loc) · 2.37 KB
/
test.yml
File metadata and controls
92 lines (74 loc) · 2.37 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
name: Unit Tests
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Cache uv packages
uses: actions/cache@v3
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install system dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -qy
sudo apt-get install -qy ffmpeg
- name: Install system dependencies (Windows)
if: matrix.os == 'windows-latest'
uses: AnimMouse/setup-ffmpeg@27e66fd2fe1d643b73a7c5cb105f3b4116bfb8db # v1.2.1
- name: Verify ffmpeg
run: ffmpeg -version
- name: Install Python dependencies
run: |
uv pip install --system -e '.[dev,tensorboard,spaces]' --prerelease=allow --python "${{ steps.setup-python.outputs.python-path }}"
uv pip install --system pytest --prerelease=allow --python "${{ steps.setup-python.outputs.python-path }}"
- name: Set up Node.js
if: matrix.os == 'ubuntu-latest'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build frontend
if: matrix.os == 'ubuntu-latest'
run: |
cd trackio/frontend
npm ci
npm run build
- name: Run frontend unit tests
if: matrix.os == 'ubuntu-latest'
run: |
cd trackio/frontend
npm test
- name: Install Playwright
if: matrix.os == 'ubuntu-latest'
run: |
"${{ steps.setup-python.outputs.python-path }}" -m playwright install chromium
- name: Run backend unit tests
run: |
"${{ steps.setup-python.outputs.python-path }}" -m pytest --deselect=tests/ui --deselect=tests/e2e-spaces
- name: Run ui/ux interaction tests
if: matrix.os == 'ubuntu-latest'
run: |
"${{ steps.setup-python.outputs.python-path }}" -m pytest tests/ui