Skip to content

Commit de00859

Browse files
Use LiveKit server GitHub action (#158)
1 parent 422f487 commit de00859

2 files changed

Lines changed: 14 additions & 45 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ jobs:
6969
- .github/workflows/ci.yml
7070
- .github/workflows/generate-docs.yml
7171
- .github/workflows/publish-docs.yml
72-
- "!AGENTS.md"
7372
cpp_checks:
7473
- src/**
7574
- include/**

.github/workflows/tests.yml

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
run: |
123123
set -eux
124124
brew update
125-
brew install cmake ninja protobuf abseil jq
125+
brew install cmake ninja protobuf abseil
126126
127127
# ---------- Rust toolchain ----------
128128
- name: Install Rust (stable)
@@ -207,48 +207,27 @@ jobs:
207207
--gtest_brief=1 `
208208
--gtest_output="xml:build-release\unit-test-results.xml"
209209
210-
# ---------- Install + start livekit-server for integration tests ----------
211-
- name: Install livekit-server and lk CLI
210+
# ---------- Start livekit-server for integration tests ----------
211+
- name: Start livekit-server
212+
if: matrix.e2e-testing
213+
id: livekit_server
214+
uses: livekit/dev-server-action@61e2b4dcb170dd3591e0c9b0db3c3fe5db93b500
215+
with:
216+
github-token: ${{ github.token }}
217+
218+
# Needed by token helper script
219+
- name: Install livekit-cli
212220
if: matrix.e2e-testing
213221
shell: bash
214222
run: |
215223
set -euxo pipefail
216224
if [[ "$RUNNER_OS" == "Linux" ]]; then
217-
# Linux: official install scripts. lk's installer parses the GitHub
218-
# API JSON with jq (already installed above).
219-
curl -sSL https://get.livekit.io | bash
220225
curl -sSL https://get.livekit.io/cli | bash
221226
else
222-
# macOS: Homebrew formulas. Server install script aborts on Darwin.
223-
brew install livekit livekit-cli
227+
brew install livekit-cli
224228
fi
225-
livekit-server --version
226229
lk --version
227230
228-
- name: Start livekit-server
229-
if: matrix.e2e-testing
230-
shell: bash
231-
env:
232-
LIVEKIT_CONFIG: "enable_data_tracks: true"
233-
run: |
234-
set -euxo pipefail
235-
# Background the server with nohup so it survives this step's shell
236-
# exit and remains running for the integration-test step.
237-
nohup livekit-server --dev > livekit-server.log 2>&1 &
238-
echo $! > livekit-server.pid
239-
# Port 7880 is a WebSocket endpoint, so a TCP-connect probe is the
240-
# most reliable readiness signal.
241-
for _ in {1..30}; do
242-
if nc -z 127.0.0.1 7880 >/dev/null 2>&1; then
243-
echo "livekit-server is ready"
244-
exit 0
245-
fi
246-
sleep 1
247-
done
248-
echo "::error::livekit-server failed to start within 30s"
249-
tail -n 200 livekit-server.log || true
250-
exit 1
251-
252231
- name: Run integration tests
253232
if: matrix.e2e-testing
254233
timeout-minutes: 5
@@ -261,19 +240,10 @@ jobs:
261240
build-release/bin/livekit_integration_tests \
262241
--gtest_output=xml:build-release/integration-test-results.xml
263242
264-
- name: Stop livekit-server
265-
if: always() && matrix.e2e-testing
266-
shell: bash
267-
run: |
268-
if [ -f livekit-server.pid ]; then
269-
kill "$(cat livekit-server.pid)" 2>/dev/null || true
270-
rm -f livekit-server.pid
271-
fi
272-
273243
- name: Dump livekit-server log on failure
274244
if: failure() && matrix.e2e-testing
275245
shell: bash
276-
run: tail -n 500 livekit-server.log || true
246+
run: tail -n 500 "${{ steps.livekit_server.outputs.log-path }}" || true
277247

278248
# ---------- Upload results ----------
279249
- name: Upload test results
@@ -284,7 +254,7 @@ jobs:
284254
path: |
285255
build-release/unit-test-results.xml
286256
build-release/integration-test-results.xml
287-
livekit-server.log
257+
${{ steps.livekit_server.outputs.log-path }}
288258
if-no-files-found: ignore
289259
retention-days: 7
290260

0 commit comments

Comments
 (0)