Port data streams over to rust livekit-ffi version #1873
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| env: | |
| APP_NAME: rtc-node | |
| MACOSX_DEPLOYMENT_TARGET: '10.13' | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write # Required to create GH releases | |
| pull-requests: write # Required to interact with PRs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| name: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 # NPM v11.5.1 or later is required for OIDC, which ships with node v24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Prettier | |
| run: pnpm format:check | |
| reuse: | |
| name: REUSE-3.2 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0 | |
| test: | |
| name: Test | |
| strategy: | |
| matrix: | |
| node-version: [20, 22, 24, latest] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Test build | |
| run: pnpm --filter="*livekit*" run build | |
| - name: Test livekit-server-sdk (Node) | |
| run: pnpm --filter="livekit-server-sdk" test | |
| - name: Test livekit-server-sdk (Browser) | |
| run: pnpm --filter="livekit-server-sdk" test:browser | |
| - name: Test env livekit-server-sdk (Edge Runtime) | |
| run: pnpm --filter="livekit-server-sdk" test:edge | |
| - name: Test rtc-node (Node) | |
| run: pnpm --filter="@livekit/rtc-node" run test | |
| env: | |
| LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }} | |
| LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }} | |
| LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }} | |
| - name: Test server sdk + rtc-node (Bun) | |
| # Run vitest under the bun runtime rather than bun's native test runner. | |
| # `--bun` forces bun to execute vitest (overriding its node shebang), so | |
| # test bodies still run on bun while vitest provides full module mocking | |
| # (vi.mock / vi.spyOn) that bun's native runner lacks. | |
| # EXPECT_BUN_RUNTIME=1 arms a guard test (src/bun_runtime.test.ts) that | |
| # fails if test bodies aren't actually executing on bun — i.e. if the | |
| # `--bun` flag ever stops overriding vitest's node shebang and the job | |
| # silently regresses to running under node. | |
| run: | | |
| bun install | |
| (cd packages/livekit-server-sdk && EXPECT_BUN_RUNTIME=1 bun --bun run test) | |
| (cd packages/livekit-rtc && EXPECT_BUN_RUNTIME=1 bun --bun run test) | |
| build_and_release: | |
| if: github.ref == 'refs/heads/main' | |
| name: Build and release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| - name: Setup node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build server SDK | |
| run: pnpm --filter="livekit-server-sdk" build | |
| - name: Build rtc-node | |
| run: pnpm --filter="@livekit/rtc-node" build | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 | |
| with: | |
| publish: pnpm ci:publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Server SDK Docs | |
| if: steps.changesets.outputs.published == 'true' | |
| run: pnpm --filter=livekit-server-sdk build-docs | |
| - name: S3 Upload Server SDK Docs | |
| if: steps.changesets.outputs.published == 'true' | |
| run: aws s3 cp packages/livekit-server-sdk/docs/ s3://livekit-docs/server-sdk-js --recursive | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }} | |
| AWS_DEFAULT_REGION: 'us-east-1' |