From 225f5538db7c71dc4ea5188c8fa5cf0462bf473c Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Tue, 2 Jun 2026 18:55:36 -0700 Subject: [PATCH 01/14] Impl --- .github/workflows/ci.yml | 5 ++- action.yml | 88 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0565fc1..c6d5a03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,11 +11,14 @@ jobs: test: name: Test (${{ matrix.os }}) strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run LiveKit Dev Server uses: ./ + with: + github-token: ${{ github.token }} diff --git a/action.yml b/action.yml index 81d2084..7be7019 100644 --- a/action.yml +++ b/action.yml @@ -4,8 +4,90 @@ description: | branding: icon: server color: blue -inputs: {} -outputs: {} +inputs: + github-token: + description: GitHub token + required: true +outputs: + pid: + description: Process ID + value: ${{ steps.start.outputs.pid }} runs: using: composite - steps: [] + steps: + - name: Brew install + if: runner.os == 'macOS' + shell: bash + env: + HOMEBREW_NO_ENV_HINTS: 1 + run: brew install livekit + - name: Resolve latest version + if: runner.os == 'Linux' || runner.os == 'Windows' + id: version + shell: bash + env: + GH_TOKEN: ${{ inputs.github-token }} + run: | + tag="$(gh api repos/livekit/livekit/releases/latest --jq '.tag_name')" + if [ -z "$tag" ]; then + echo "::error::Failed to resolve version tag" + exit 1 + fi + echo "Latest version tag: $tag" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + - name: Download release artifact + if: runner.os == 'Linux' || runner.os == 'Windows' + shell: bash + env: + GH_TOKEN: ${{ inputs.github-token }} + run: | + case "${RUNNER_OS}-${RUNNER_ARCH}" in + Linux-X64) suffix='linux_amd64.tar.gz' ;; + Linux-ARM64) suffix='linux_arm64.tar.gz' ;; + Windows-X64) suffix='windows_amd64.zip' ;; + Windows-ARM64) suffix='windows_arm64.zip' ;; + *) echo "Unsupported platform: ${RUNNER_OS}-${RUNNER_ARCH}"; exit 1 ;; + esac + echo "::debug::Artifact suffix: $suffix" + + gh release download "${{ steps.version.outputs.tag }}" \ + --repo livekit/livekit \ + --pattern "*_${suffix}" \ + --output release-archive + + test -f release-archive || { + echo "::error::Release artifact was not downloaded" + exit 1 + } + + - name: Extract release artifact + if: runner.os == 'Linux' || runner.os == 'Windows' + shell: bash + run: | + case "${RUNNER_OS}" in + Linux) + tar -xzf ./release-archive + chmod +x ./livekit-server + ;; + Windows) + unzip -o ./release-archive + ;; + esac + + - name: Run server + id: start + shell: bash + run: | + case "${RUNNER_OS}" in + macOS) livekit_cmd="livekit-server" ;; + Linux) livekit_cmd="./livekit-server" ;; + Windows) livekit_cmd="./livekit-server.exe" ;; + *) echo "::error::Unsupported platform: ${RUNNER_OS}"; exit 1 ;; + esac + + "$livekit_cmd" --version + + "$livekit_cmd" --dev > livekit.log 2>&1 & + pid=$! + echo "Running server in the background: pid=$pid" + echo "pid=$pid" >> "$GITHUB_OUTPUT" From c54a10157529afb799420d47b71f3cee84c8cca6 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:21:08 -0700 Subject: [PATCH 02/14] Support passing additional args --- action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 7be7019..46c956d 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: github-token: description: GitHub token required: true + args: + description: Additional arguments to pass to the LiveKit server + required: false + default: "" outputs: pid: description: Process ID @@ -77,6 +81,8 @@ runs: - name: Run server id: start shell: bash + env: + LIVEKIT_ARGS: ${{ inputs.args }} run: | case "${RUNNER_OS}" in macOS) livekit_cmd="livekit-server" ;; @@ -87,7 +93,7 @@ runs: "$livekit_cmd" --version - "$livekit_cmd" --dev > livekit.log 2>&1 & + "$livekit_cmd" --dev $LIVEKIT_ARGS > livekit.log 2>&1 & pid=$! echo "Running server in the background: pid=$pid" echo "pid=$pid" >> "$GITHUB_OUTPUT" From dcba217749a5981fe8d99dfb6c0a79f97eb2cc1e Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:28:13 -0700 Subject: [PATCH 03/14] Verify server health --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6d5a03..d4add25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Run LiveKit Dev Server + - name: Run LiveKit server uses: ./ with: github-token: ${{ github.token }} + - name: Health check + shell: bash + run: | + set -euo pipefail + for i in $(seq 1 30); do + body="$(curl -fsS http://localhost:7880/ || true)" + if [ "$body" = "OK" ]; then + echo "Server is healthy" + exit 0 + fi + echo "Waiting for server... ($i)" + sleep 1 + done + echo "::error::Server is not running" + exit 1 \ No newline at end of file From d13899abbbb85749f4eb88a0c6878bf246b4ee88 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:33:54 -0700 Subject: [PATCH 04/14] Wait for server in action --- .github/workflows/ci.yml | 17 +---------------- action.yml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4add25..73692e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,19 +21,4 @@ jobs: - name: Run LiveKit server uses: ./ with: - github-token: ${{ github.token }} - - name: Health check - shell: bash - run: | - set -euo pipefail - for i in $(seq 1 30); do - body="$(curl -fsS http://localhost:7880/ || true)" - if [ "$body" = "OK" ]; then - echo "Server is healthy" - exit 0 - fi - echo "Waiting for server... ($i)" - sleep 1 - done - echo "::error::Server is not running" - exit 1 \ No newline at end of file + github-token: ${{ github.token }} \ No newline at end of file diff --git a/action.yml b/action.yml index 46c956d..b0dd819 100644 --- a/action.yml +++ b/action.yml @@ -97,3 +97,18 @@ runs: pid=$! echo "Running server in the background: pid=$pid" echo "pid=$pid" >> "$GITHUB_OUTPUT" + + - name: Health check + shell: bash + run: | + set -u + for i in $(seq 1 10); do + if [ "$(curl -fsS http://localhost:7880/ || true)" = "OK" ]; then + echo "Server passed health check" + exit 0 + fi + echo "Waiting for server... (retry $i/10)" + sleep 1 + done + echo "::error::Server did not pass health check" + exit 1 From 07b693a08534e3d9ae039cbdfe2e6d29464893c0 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:21:20 -0700 Subject: [PATCH 05/14] Format --- action.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index b0dd819..de1f06b 100644 --- a/action.yml +++ b/action.yml @@ -69,13 +69,8 @@ runs: shell: bash run: | case "${RUNNER_OS}" in - Linux) - tar -xzf ./release-archive - chmod +x ./livekit-server - ;; - Windows) - unzip -o ./release-archive - ;; + Linux) tar -xzf ./release-archive && chmod +x ./livekit-server ;; + Windows) unzip -o ./release-archive ;; esac - name: Run server From 8d515a6e61652a279a3cd31cce1c1977918decae Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:24:04 -0700 Subject: [PATCH 06/14] Use temp directory --- action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index de1f06b..b81c7e8 100644 --- a/action.yml +++ b/action.yml @@ -57,9 +57,9 @@ runs: gh release download "${{ steps.version.outputs.tag }}" \ --repo livekit/livekit \ --pattern "*_${suffix}" \ - --output release-archive + --output "$RUNNER_TEMP/release-archive" - test -f release-archive || { + test -f "$RUNNER_TEMP/release-archive" || { echo "::error::Release artifact was not downloaded" exit 1 } @@ -69,8 +69,8 @@ runs: shell: bash run: | case "${RUNNER_OS}" in - Linux) tar -xzf ./release-archive && chmod +x ./livekit-server ;; - Windows) unzip -o ./release-archive ;; + Linux) tar -xzf "$RUNNER_TEMP/release-archive" -C "$RUNNER_TEMP" && chmod +x "$RUNNER_TEMP/livekit-server" ;; + Windows) unzip -o "$RUNNER_TEMP/release-archive" -d "$RUNNER_TEMP" ;; esac - name: Run server @@ -81,14 +81,14 @@ runs: run: | case "${RUNNER_OS}" in macOS) livekit_cmd="livekit-server" ;; - Linux) livekit_cmd="./livekit-server" ;; - Windows) livekit_cmd="./livekit-server.exe" ;; + Linux) livekit_cmd="$RUNNER_TEMP/livekit-server" ;; + Windows) livekit_cmd="$RUNNER_TEMP/livekit-server.exe" ;; *) echo "::error::Unsupported platform: ${RUNNER_OS}"; exit 1 ;; esac "$livekit_cmd" --version - "$livekit_cmd" --dev $LIVEKIT_ARGS > livekit.log 2>&1 & + "$livekit_cmd" --dev $LIVEKIT_ARGS > "$RUNNER_TEMP/livekit.log" 2>&1 & pid=$! echo "Running server in the background: pid=$pid" echo "pid=$pid" >> "$GITHUB_OUTPUT" From 9b6195a3c3e5e94ed5c7304ec5a29fe554d32d11 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:28:52 -0700 Subject: [PATCH 07/14] Expose log path to caller --- .github/workflows/ci.yml | 9 ++++++++- action.yml | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73692e1..3504531 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,13 @@ jobs: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run LiveKit server + id: server uses: ./ with: - github-token: ${{ github.token }} \ No newline at end of file + github-token: ${{ github.token }} + - name: Upload server log + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: server-log-${{ matrix.os }} + path: ${{ steps.server.outputs.log-path }} + if-no-files-found: error \ No newline at end of file diff --git a/action.yml b/action.yml index b81c7e8..63071a3 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,9 @@ outputs: pid: description: Process ID value: ${{ steps.start.outputs.pid }} + log-path: + description: Path to the server log file + value: ${{ steps.start.outputs.log-path }} runs: using: composite steps: @@ -92,6 +95,7 @@ runs: pid=$! echo "Running server in the background: pid=$pid" echo "pid=$pid" >> "$GITHUB_OUTPUT" + echo "log-path=$RUNNER_TEMP/livekit.log" >> "$GITHUB_OUTPUT" - name: Health check shell: bash From 4f43597eb209f1875551b6fdbaf5e1e766c1d497 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:56:59 -0700 Subject: [PATCH 08/14] Accept yaml config, no args --- action.yml | 27 ++++++++++++++++++++++----- resources/base-config.yaml | 2 ++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 resources/base-config.yaml diff --git a/action.yml b/action.yml index 63071a3..a4fee31 100644 --- a/action.yml +++ b/action.yml @@ -8,8 +8,8 @@ inputs: github-token: description: GitHub token required: true - args: - description: Additional arguments to pass to the LiveKit server + config: + description: Server configuration YAML required: false default: "" outputs: @@ -76,11 +76,28 @@ runs: Windows) unzip -o "$RUNNER_TEMP/release-archive" -d "$RUNNER_TEMP" ;; esac + - name: Install yq (Windows) + if: runner.os == 'Windows' + shell: bash + run: choco install yq --no-progress -y + + - name: Build merged config + shell: bash + env: + LIVEKIT_CONFIG_OVERLAY: ${{ inputs.config }} + run: | + set -u + printf '%s' "$LIVEKIT_CONFIG_OVERLAY" > "$RUNNER_TEMP/overlay.yaml" + yq ea '. as $item ireduce ({}; . * $item)' \ + "$GITHUB_ACTION_PATH/resources/base-config.yaml" "$RUNNER_TEMP/overlay.yaml" \ + > "$RUNNER_TEMP/livekit.yaml" + echo "::group::Merged LiveKit config" + cat "$RUNNER_TEMP/livekit.yaml" + echo "::endgroup::" + - name: Run server id: start shell: bash - env: - LIVEKIT_ARGS: ${{ inputs.args }} run: | case "${RUNNER_OS}" in macOS) livekit_cmd="livekit-server" ;; @@ -91,7 +108,7 @@ runs: "$livekit_cmd" --version - "$livekit_cmd" --dev $LIVEKIT_ARGS > "$RUNNER_TEMP/livekit.log" 2>&1 & + "$livekit_cmd" --config "$RUNNER_TEMP/livekit.yaml" --dev > "$RUNNER_TEMP/livekit.log" 2>&1 & pid=$! echo "Running server in the background: pid=$pid" echo "pid=$pid" >> "$GITHUB_OUTPUT" diff --git a/resources/base-config.yaml b/resources/base-config.yaml new file mode 100644 index 0000000..efa159d --- /dev/null +++ b/resources/base-config.yaml @@ -0,0 +1,2 @@ +# Base configuration passed to the LiveKit server. +logging: { json: true } From 30ad211bcb61b23a0e3a2766c14d8fd826cd7a3a Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:06:11 -0700 Subject: [PATCH 09/14] Install yq --- action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index a4fee31..a6d4e37 100644 --- a/action.yml +++ b/action.yml @@ -76,10 +76,8 @@ runs: Windows) unzip -o "$RUNNER_TEMP/release-archive" -d "$RUNNER_TEMP" ;; esac - - name: Install yq (Windows) - if: runner.os == 'Windows' - shell: bash - run: choco install yq --no-progress -y + - name: Install yq + uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b - name: Build merged config shell: bash From ee30a0200af427240badb23a9a5e7d2474342cd9 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:10:51 -0700 Subject: [PATCH 10/14] Use proper ext --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a6d4e37..b34405d 100644 --- a/action.yml +++ b/action.yml @@ -106,11 +106,11 @@ runs: "$livekit_cmd" --version - "$livekit_cmd" --config "$RUNNER_TEMP/livekit.yaml" --dev > "$RUNNER_TEMP/livekit.log" 2>&1 & + "$livekit_cmd" --config "$RUNNER_TEMP/livekit.yaml" --dev > "$RUNNER_TEMP/livekit.jsonl" 2>&1 & pid=$! echo "Running server in the background: pid=$pid" echo "pid=$pid" >> "$GITHUB_OUTPUT" - echo "log-path=$RUNNER_TEMP/livekit.log" >> "$GITHUB_OUTPUT" + echo "log-path=$RUNNER_TEMP/livekit.jsonl" >> "$GITHUB_OUTPUT" - name: Health check shell: bash From 4493b31170702046a82faf42fcba384a0c9710a9 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:18:41 -0700 Subject: [PATCH 11/14] Revert "Install yq" This reverts commit 30ad211bcb61b23a0e3a2766c14d8fd826cd7a3a. --- action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index b34405d..3c1a92f 100644 --- a/action.yml +++ b/action.yml @@ -76,8 +76,10 @@ runs: Windows) unzip -o "$RUNNER_TEMP/release-archive" -d "$RUNNER_TEMP" ;; esac - - name: Install yq - uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b + - name: Install yq (Windows) + if: runner.os == 'Windows' + shell: bash + run: choco install yq --no-progress -y - name: Build merged config shell: bash From 4e59e181666def16ed9215d35c583ed5a4e4d659 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:28:33 -0700 Subject: [PATCH 12/14] Add documentation --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 50969e1..c3cc6b7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ # LiveKit Dev Server Action Install and run a LiveKit server in development mode for end-to-end testing. + +## Usage + +```yaml +- uses: livekit/dev-server-action@v1 + with: + github-token: ${{ github.token }} +``` + +## Inputs + +| Name | Required | Default | Description | +| -------------- | -------- | ------- | -------------------------------------------------------------------- | +| `github-token` | Yes | | Token used to download the LiveKit server release. | +| `config` | No | `""` | Partial LiveKit config (YAML), deep-merged over the action defaults. | + +## Outputs + +| Name | Description | +| ---------- | --------------------------------- | +| `pid` | Process ID of the running server. | +| `log-path` | Path to the server log file. | From f9436b7801eacb1656235ec440678f6c1fb174b1 Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:30:03 -0700 Subject: [PATCH 13/14] Add docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3cc6b7..1d093e9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Install and run a LiveKit server in development mode for end-to-end testing. | Name | Required | Default | Description | | -------------- | -------- | ------- | -------------------------------------------------------------------- | | `github-token` | Yes | | Token used to download the LiveKit server release. | -| `config` | No | `""` | Partial LiveKit config (YAML), deep-merged over the action defaults. | +| `config` | No | `""` | Server configuration YAML ## Outputs From aa324a945bb0a7a6f64f9194e25f00ccf41ab3ea Mon Sep 17 00:00:00 2001 From: Jacob Gelman <3182119+ladvoc@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:31:16 -0700 Subject: [PATCH 14/14] Add badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1d093e9..83b344c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # LiveKit Dev Server Action +[![CI](https://github.com/livekit/dev-server-action/actions/workflows/ci.yml/badge.svg)](https://github.com/livekit/dev-server-action/actions/workflows/ci.yml) + Install and run a LiveKit server in development mode for end-to-end testing. ## Usage