Skip to content

Commit

Permalink
ci: test on all platforms (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp authored Aug 12, 2024
1 parent 83f5dc8 commit 8777839
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,23 @@ on:

jobs:
tests:
name: Run tests
runs-on: namespace-profile-4vcpu-cache
strategy:
fail-fast: false
matrix:
include:
- os: macos-14-large
platform: macos
- os: macos-14
platform: macos
- os: windows-2019
platform: windows
- os: ubuntu-20.04
platform: linux
- os: namespace-profile-default-arm64
platform: linux

runs-on: ${{ matrix.os }}
name: Run tests (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -26,10 +41,29 @@ jobs:
python-version: '3.9'
cache: 'pip'

- name: install ffmpeg
- name: Install ffmpeg (Linux)
if: ${{ matrix.platform == 'linux' }}
run: sudo apt-get update && sudo apt-get install -y ffmpeg

- name: install packages
# Azure plugin fails with OpenSSL3, and Ubuntu 22.04 does not include libssl1.1 in its repos
- name: Install libssl 1.1 (Linux 22.04)
if: ${{ matrix.os == 'namespace-profile-default-arm64' }}
run: |
wget https://old-releases.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1_arm64.deb
wget https://old-releases.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1_arm64.deb
sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1_arm64.deb
sudo dpkg -i libssl-dev_1.1.1-1ubuntu2.1_arm64.deb
- name: Install ffmpeg (macOS)
if: ${{ matrix.platform == 'macos' }}
run: brew update && brew install ffmpeg

- name: Install ffmpeg (Windows)
if: ${{ matrix.platform == 'windows' }}
run: choco install ffmpeg

- name: Install packages
shell: bash
run: |
pip3 install pytest pytest-asyncio pytest-timeout './livekit-agents[codecs]' psutil
pip3 install -r ./tests/test-requirements.txt
Expand All @@ -44,6 +78,7 @@ jobs:
./livekit-plugins/livekit-plugins-azure
- name: Run tests
shell: bash
env:
LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
Expand Down
4 changes: 3 additions & 1 deletion livekit-agents/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
"watchfiles~=0.22",
"psutil~=5.9",
"aiohttp~=3.10",
"aiodns~=3.2",
],
extras_require={
':sys_platform=="win32"': [
"colorama"
], # fix logs color on windows (devmode only)
':sys_platform!="win32"': [
"aiodns~=3.2"
], # use default aiohttp resolver on windows
"codecs": ["av>=11.0.0"],
"images": ["pillow~=10.3.0"],
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def _assert_valid_synthesized_audio(

@pytest.mark.usefixtures("job_process")
@pytest.mark.parametrize("tts", SYNTHESIZE_TTS)
async def test_synthetize(tts: agents.tts.TTS):
async def test_synthesize(tts: agents.tts.TTS):
frames = []
async for audio in tts.synthesize(text=TEST_AUDIO_SYNTHESIZE):
frames.append(audio.frame)
Expand Down

0 comments on commit 8777839

Please sign in to comment.