Skip to content
Draft
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
253 changes: 0 additions & 253 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,256 +330,3 @@ jobs:
else
./build.sh clean-all || true
fi

docker-build-x64:
name: Build (docker-linux-x64)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- name: Checkout (with submodules)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
fetch-depth: 0

- name: Check if Dockerfile.base changed
id: base_changed
shell: bash
run: |
set -euo pipefail
if git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -q '^docker/Dockerfile\.base$'; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Pull base image from GHCR
if: steps.base_changed.outputs.changed == 'false'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euxo pipefail
owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker pull "ghcr.io/${owner}/client-sdk-cpp-base:base-main-amd64"
docker tag "ghcr.io/${owner}/client-sdk-cpp-base:base-main-amd64" \
"livekit-cpp-sdk-base-x64:${{ github.sha }}"

- name: Build base Docker image
if: steps.base_changed.outputs.changed == 'true'
run: |
docker build \
--build-arg TARGETARCH=amd64 \
-t livekit-cpp-sdk-base-x64:${{ github.sha }} \
-f docker/Dockerfile.base \
docker

- name: Build SDK Docker image
run: |
docker build \
--build-arg BASE_IMAGE=livekit-cpp-sdk-base-x64:${{ github.sha }} \
-t livekit-cpp-sdk-x64:${{ github.sha }} \
. \
-f docker/Dockerfile.sdk

- name: Verify installed SDK inside image
run: |
docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -c \
'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake'

- name: Save Docker image artifact
run: |
docker save livekit-cpp-sdk-x64:${{ github.sha }} | gzip > livekit-cpp-sdk-x64-docker.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: livekit-cpp-sdk-docker-x64
path: livekit-cpp-sdk-x64-docker.tar.gz
retention-days: 7

docker-build-linux-arm64:
name: Build (docker-linux-arm64)
runs-on: ubuntu-24.04-arm
if: github.event_name == 'pull_request'

steps:
- name: Checkout (with submodules)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
fetch-depth: 0

- name: Check if Dockerfile.base changed
id: base_changed
shell: bash
run: |
set -euo pipefail
if git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -q '^docker/Dockerfile\.base$'; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Pull base image from GHCR
if: steps.base_changed.outputs.changed == 'false'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euxo pipefail
owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker pull "ghcr.io/${owner}/client-sdk-cpp-base:base-main-arm64"
docker tag "ghcr.io/${owner}/client-sdk-cpp-base:base-main-arm64" \
"livekit-cpp-sdk-base-arm64:${{ github.sha }}"

- name: Build base Docker image
if: steps.base_changed.outputs.changed == 'true'
run: |
docker build \
--build-arg TARGETARCH=arm64 \
-t livekit-cpp-sdk-base-arm64:${{ github.sha }} \
-f docker/Dockerfile.base \
docker

- name: Build SDK Docker image
run: |
docker build \
--build-arg BASE_IMAGE=livekit-cpp-sdk-base-arm64:${{ github.sha }} \
-t livekit-cpp-sdk:${{ github.sha }} \
. \
-f docker/Dockerfile.sdk

- name: Verify installed SDK inside image
run: |
docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -c \
'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake'

- name: Save Docker image artifact
run: |
docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64-docker.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: livekit-cpp-sdk-docker-arm64
path: livekit-cpp-sdk-arm64-docker.tar.gz
retention-days: 7

build-collections-linux-arm64:
name: Build (cpp-example-collection-linux-arm64)
runs-on: ubuntu-24.04-arm
needs: docker-build-linux-arm64
if: github.event_name == 'pull_request'

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1

# Reclaim ~30GB before loading the multi-GB SDK image and building the
# example collection inside it. Mirrors the docker-build jobs; without it
# the x64 collection build has hit "no space left on device".
- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Download Docker image artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: livekit-cpp-sdk-docker-arm64

- name: Load Docker image
run: gzip -dc livekit-cpp-sdk-arm64-docker.tar.gz | docker load

- name: Build cpp-example-collection against installed SDK
run: |
cpp_ex_ref="$(git rev-parse HEAD:cpp-example-collection)"
docker run -e CPP_EX_REF="${cpp_ex_ref}" --rm livekit-cpp-sdk:${{ github.sha }} bash -lc '
set -euxo pipefail
git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection
cd /tmp/cpp-example-collection
git fetch --depth 1 origin "$CPP_EX_REF"
git checkout "$CPP_EX_REF"
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
cmake --build build --parallel
'
build-collections-x64:
name: Build (cpp-example-collection-x64)
runs-on: ubuntu-latest
needs: docker-build-x64
if: github.event_name == 'pull_request'

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1

# Reclaim ~30GB before loading the multi-GB SDK image and building the
# example collection inside it. The standard ubuntu-latest runner has hit
# "no space left on device" here without this step.
- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Download Docker image artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: livekit-cpp-sdk-docker-x64

- name: Load Docker image
run: gzip -dc livekit-cpp-sdk-x64-docker.tar.gz | docker load

- name: Build cpp-example-collection against installed SDK
run: |
cpp_ex_ref="$(git rev-parse HEAD:cpp-example-collection)"
docker run -e CPP_EX_REF="${cpp_ex_ref}" --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -lc '
set -euxo pipefail
git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection
cd /tmp/cpp-example-collection
git fetch --depth 1 origin "$CPP_EX_REF"
git checkout "$CPP_EX_REF"
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
cmake --build build --parallel
'
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
permissions:
contents: read
actions: read
packages: read
packages: write

jobs:
# Compute once which path groups changed; every other job references these
Expand All @@ -23,6 +23,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
builds: ${{ steps.filter.outputs.builds }}
docker: ${{ steps.filter.outputs.docker }}
tests: ${{ steps.filter.outputs.tests }}
docs: ${{ steps.filter.outputs.docs }}
cpp_checks: ${{ steps.filter.outputs.cpp_checks }}
Expand All @@ -40,14 +41,23 @@ jobs:
- cpp-example-collection/**
- client-sdk-rust/**
- cmake/**
- docker/**
- CMakeLists.txt
- CMakePresets.json
- build*
- .build*
- vcpkg.json
- .github/workflows/ci.yml
- .github/workflows/builds.yml
docker:
- docker/**
- .dockerignore
- CMakeLists.txt
- CMakePresets.json
- build*
- .build*
- cmake/**
- .github/workflows/ci.yml
- .github/workflows/docker-images.yml
tests:
- src/**
- include/**
Expand Down Expand Up @@ -92,6 +102,13 @@ jobs:
uses: ./.github/workflows/builds.yml
secrets: inherit

# docker-images:
# name: Docker Images
# needs: changes
# if: ${{ needs.changes.outputs.docker == 'true' || github.event_name == 'workflow_dispatch' }}
# uses: ./.github/workflows/docker-images.yml
# secrets: inherit

tests:
name: Tests
needs: changes
Expand Down Expand Up @@ -126,6 +143,7 @@ jobs:
needs:
- changes
- builds
# - docker-images
- tests
- license-check
- cpp-checks
Expand Down
Loading
Loading