|
26 | 26 |
|
27 | 27 | jobs: |
28 | 28 | failover: |
| 29 | + name: API (Python ${{ matrix.python-version }}) |
29 | 30 | runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
30 | 35 | services: |
31 | 36 | mock-server: |
32 | 37 | image: livekit/test-server:latest |
|
42 | 47 |
|
43 | 48 | - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 |
44 | 49 | with: |
45 | | - python-version: "3.12" |
| 50 | + python-version: ${{ matrix.python-version }} |
46 | 51 |
|
47 | 52 | - name: Install uv |
48 | 53 | uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 |
|
51 | 56 | run: | |
52 | 57 | uv venv .failover-venv |
53 | 58 | source .failover-venv/bin/activate |
54 | | - uv pip install ./livekit-protocol ./livekit-api pytest aiohttp |
| 59 | + uv pip install ./livekit-protocol ./livekit-api "pytest>=9.0.3; python_version >= '3.10'" "pytest==8.4.2; python_version < '3.10'" |
| 60 | + uv pip check |
55 | 61 |
|
56 | 62 | - name: Wait for mock server |
57 | 63 | run: | |
|
64 | 70 | - name: Run API tests |
65 | 71 | run: | |
66 | 72 | source .failover-venv/bin/activate |
67 | | - pytest tests/api -v |
| 73 | + # Use a private directory instead of pytest's shared /tmp default. |
| 74 | + pytest tests/api -v --basetemp="$(mktemp -d)" |
| 75 | +
|
| 76 | + wheels: |
| 77 | + name: API wheels (${{ matrix.os }}, Python ${{ matrix.python-version }}, ${{ matrix.resolution }}) |
| 78 | + runs-on: ${{ matrix.os }} |
| 79 | + strategy: |
| 80 | + fail-fast: false |
| 81 | + matrix: |
| 82 | + os: [macos-latest, windows-latest] |
| 83 | + python-version: ["3.9", "3.14"] |
| 84 | + resolution: [lowest-direct, highest] |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 |
| 87 | + |
| 88 | + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 |
| 89 | + with: |
| 90 | + python-version: ${{ matrix.python-version }} |
| 91 | + |
| 92 | + - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 |
| 93 | + |
| 94 | + - name: Build and install distributions |
| 95 | + shell: bash |
| 96 | + run: | |
| 97 | + uv build --package livekit-api --out-dir dist |
| 98 | + uv build --package livekit-protocol --out-dir dist |
| 99 | + uv venv .api-wheel-venv |
| 100 | + uv pip install --python .api-wheel-venv --resolution '${{ matrix.resolution }}' dist/*.whl "pytest>=9.0.3; python_version >= '3.10'" "pytest==8.4.2; python_version < '3.10'" |
| 101 | + uv pip check --python .api-wheel-venv |
| 102 | +
|
| 103 | + - name: Test token and webhook compatibility |
| 104 | + shell: bash |
| 105 | + run: | |
| 106 | + if [ "$RUNNER_OS" = Windows ]; then |
| 107 | + test_python=.api-wheel-venv/Scripts/python.exe |
| 108 | + else |
| 109 | + test_python=.api-wheel-venv/bin/python |
| 110 | + fi |
| 111 | + "$test_python" -m pytest tests/api/test_access_token.py tests/api/test_webhook.py -v --basetemp="$RUNNER_TEMP/pytest-api" |
0 commit comments