Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 57 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,82 @@ name: CI
on: [push]

jobs:
static-checks:
lint-and-format:
runs-on: ubuntu-latest
strategy: &python-matrix
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
name: static-checks
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install project dependencies
run: uv sync --locked --all-extras --dev --all-packages
run: uv sync --locked --all-extras --all-packages

- name: Format
- name: Format Check
run: uv run format_check

- name: Lint
run: uv run lint

type-check:
runs-on: ubuntu-latest
strategy: &strategy
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install project dependencies
run: uv sync --locked --all-extras --all-packages

- name: Type check
run: uv run pyright

test:
runs-on: ubuntu-latest
strategy: *python-matrix
env:
PYTHON_VERSION: ${{ matrix.python-version }}
name: test
needs: [lint-and-format]
strategy: *strategy
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | docker login ghcr.io -u USERNAME --password-stdin
- name: Install project dependencies
run: uv sync --locked --all-extras --all-packages

- name: Run tests
run: docker compose -f docker-compose-test.yaml up test --exit-code-from test
- name: Initialize Localtunnel
id: tunnel
run: |
npx localtunnel --port 5000 > tunnel.log 2>&1 &

# Poll for the URL
TIMEOUT=10
ELAPSED=0
echo "Waiting for localtunnel to generate URL..."

while ! grep -q "https://" tunnel.log; do
if [ $ELAPSED -ge $TIMEOUT ]; then
echo "Error: Localtunnel timed out after ${TIMEOUT}s"
cat tunnel.log
exit 1
fi
sleep 1
ELAPSED=$((ELAPSED + 1))
done

TUNNEL_URL=$(grep -o 'https://[^ ]*' tunnel.log | head -n 1)
echo "url=$TUNNEL_URL" >> $GITHUB_OUTPUT
echo "Localtunnel is live at: $TUNNEL_URL"

- name: Tear down test containers
run: docker compose -f docker-compose-test.yaml down
- name: Run tests
run: uv run pytest
env:
WEBHOOK_SERVER_URL: ${{ steps.tunnel.outputs.url }}
FISHJAM_ID: ${{ secrets.CI_FISHJAM_ID }}
FISHJAM_MANAGEMENT_TOKEN: ${{ secrets.CI_FISHJAM_MANAGEMENT_TOKEN }}
75 changes: 0 additions & 75 deletions docker-compose-test.yaml

This file was deleted.

20 changes: 10 additions & 10 deletions fishjam/_openapi_client/api/room/add_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.add_peer_body import AddPeerBody
from ...models.error import Error
from ...models.peer_config import PeerConfig
from ...models.peer_details_response import PeerDetailsResponse
from ...types import Response


def _get_kwargs(
room_id: str,
*,
body: AddPeerBody,
body: PeerConfig,
) -> dict[str, Any]:
headers: dict[str, Any] = {}

Expand Down Expand Up @@ -81,13 +81,13 @@ def sync_detailed(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Response[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -113,13 +113,13 @@ def sync(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Optional[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -140,13 +140,13 @@ async def asyncio_detailed(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Response[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -170,13 +170,13 @@ async def asyncio(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Optional[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand Down
4 changes: 2 additions & 2 deletions fishjam/_openapi_client/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Contains all the data models used in inputs/outputs"""

from .add_peer_body import AddPeerBody
from .agent_output import AgentOutput
from .audio_format import AudioFormat
from .audio_sample_rate import AudioSampleRate
from .error import Error
from .peer import Peer
from .peer_config import PeerConfig
from .peer_details_response import PeerDetailsResponse
from .peer_details_response_data import PeerDetailsResponseData
from .peer_metadata import PeerMetadata
Expand Down Expand Up @@ -41,12 +41,12 @@
from .web_rtc_metadata import WebRTCMetadata

__all__ = (
"AddPeerBody",
"AgentOutput",
"AudioFormat",
"AudioSampleRate",
"Error",
"Peer",
"PeerConfig",
"PeerDetailsResponse",
"PeerDetailsResponseData",
"PeerMetadata",
Expand Down
21 changes: 1 addition & 20 deletions fishjam/_openapi_client/models/agent_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
)

from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..models.audio_format import AudioFormat
from ..models.audio_sample_rate import AudioSampleRate
Expand All @@ -26,7 +25,6 @@ class AgentOutput:

audio_format: Union[Unset, AudioFormat] = UNSET
audio_sample_rate: Union[Unset, AudioSampleRate] = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
audio_format: Union[Unset, str] = UNSET
Expand All @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]:
audio_sample_rate = self.audio_sample_rate.value

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)

field_dict.update({})
if audio_format is not UNSET:
field_dict["audioFormat"] = audio_format
Expand Down Expand Up @@ -69,21 +67,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
audio_sample_rate=audio_sample_rate,
)

agent_output.additional_properties = d
return agent_output

@property
def additional_keys(self) -> list[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
Loading