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
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Copyright 2026 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: CI
on:
schedule:
- cron: 0 0 * * 1
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: [main]
concurrency:
group: "ci"
Comment thread
stephen-derosa marked this conversation as resolved.
cancel-in-progress: true
jobs:
license-check:
name: License Check
uses: ./.github/workflows/license_check.yml

pin-check:
name: Pin Check
uses: ./.github/workflows/pin_check.yml

build:
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.runs_on }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: macOS arm64
runs_on: macos-latest
- name: Linux x64
runs_on: ubuntu-24.04
- name: Linux ARM64
runs_on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libgtk-3-dev \
libglfw3-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
liblz4-dev \
libprotobuf-dev \
libssl-dev \
libudev-dev \
libusb-1.0-0-dev \
libxss-dev \
libzstd-dev \
pkg-config \
protobuf-compiler \
wget \
zlib1g-dev \
&& sudo apt-get autoremove -y && sudo apt-get clean -y

- name: Build and install librealsense2 from source (Linux)
if: runner.os == 'Linux'
run: |
set -euxo pipefail
src="${{ runner.temp }}/librealsense"
librealsense_ref="v2.55.1"
git clone --branch "$librealsense_ref" --depth 1 --single-branch https://github.com/realsenseai/librealsense.git "$src"
cd "$src"
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
mkdir -p build && cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
make -j"$(( $(nproc) - 1 ))"
sudo make install
Comment thread
stephen-derosa marked this conversation as resolved.

- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install \
cmake \
librealsense \
lz4 \
pkg-config \
protobuf \
zstd

- name: Setup project dependencies
run: ./setup_realsense.sh

- name: Build project
env:
GITHUB_TOKEN: ${{ github.token }}
run: ./build.sh
37 changes: 37 additions & 0 deletions .github/workflows/license_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2026 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: License Check
on:
workflow_call: {}
workflow_dispatch: {}
jobs:
license-check:
name: License Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Check License Headers
shell: bash
run: |
shopt -s globstar
# ghcr.io/google/addlicense v1.2.0
docker run --rm -v ${PWD}:/src -w /src ghcr.io/google/addlicense@sha256:5a48f41ccc8cf3fdd04499649f02a9ee5877ab6f39fd1ac18fd1db5eb1062c5a \
-check \
-l apache \
-c "LiveKit, Inc." \
**/*.{cpp,h}
32 changes: 32 additions & 0 deletions .github/workflows/pin_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2026 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Pin Check
on:
workflow_call: {}
workflow_dispatch:

jobs:
pin-check:
name: Pin Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Pin Check
uses: suzuki-shunsuke/pinact-action@cf51507d80d4d6522a07348e3d58790290eaf0b6 # v2.0.0
with:
skip_push: true
38 changes: 32 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,40 @@ else()
endif()
find_package(LiveKit CONFIG REQUIRED)

find_package(Protobuf REQUIRED CONFIG)
if(TARGET LiveKit::livekit)
set(LIVEKIT_CORE_TARGET LiveKit::livekit)
elseif(TARGET livekit)
set(LIVEKIT_CORE_TARGET livekit)
else()
message(FATAL_ERROR
"Could not find a LiveKit core target (expected LiveKit::livekit or livekit).")
endif()
Comment thread
stephen-derosa marked this conversation as resolved.

# Prefer a package config install so modern protobuf releases can expose their
# absl/utf8_range transitive dependencies. Fall back to CMake's built-in module
# for environments such as Ubuntu's libprotobuf-dev.
find_package(Protobuf CONFIG QUIET)
if(NOT TARGET protobuf::libprotobuf)
find_package(Protobuf REQUIRED)
endif()
find_package(realsense2 REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SPDLOG REQUIRED IMPORTED_TARGET spdlog)
pkg_check_modules(ZSTD REQUIRED IMPORTED_TARGET libzstd)
pkg_check_modules(LZ4 REQUIRED IMPORTED_TARGET liblz4)
find_package(ZLIB REQUIRED)

function(prepend_livekit_includes target_name)
get_target_property(_livekit_include_dirs
${LIVEKIT_CORE_TARGET}
INTERFACE_INCLUDE_DIRECTORIES
)
if(_livekit_include_dirs)
target_include_directories(${target_name} BEFORE PRIVATE
${_livekit_include_dirs}
)
endif()
endfunction()

set(REALSENSE_MCAP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(REALSENSE_EXTERNAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external")
set(REALSENSE_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
Expand Down Expand Up @@ -90,12 +116,12 @@ add_executable(realsense_publisher
${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(realsense_publisher PRIVATE
LiveKit::livekit
PkgConfig::SPDLOG
${LIVEKIT_CORE_TARGET}
${realsense2_LIBRARY}
protobuf::libprotobuf
ZLIB::ZLIB
)
prepend_livekit_includes(realsense_publisher)

add_library(mcap_recorder_core
${REALSENSE_MCAP_DIR}/src/common/mcap_recorder_core.cpp
Expand Down Expand Up @@ -129,7 +155,7 @@ add_executable(realsense_publisher
)
target_link_libraries(mcap_recorder PRIVATE
mcap_recorder_core
LiveKit::livekit
PkgConfig::SPDLOG
${LIVEKIT_CORE_TARGET}
)
prepend_livekit_includes(mcap_recorder)
message(STATUS "LiveKit participants: realsense_publisher, mcap_recorder")
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ Then point this project at that prefix:
- `mcap_recorder`: subscriber/recorder participant. It connects to the same room,
subscribes to the published RGB + depth tracks, and writes the received data
back out to an MCAP file.

__NOTE: On macOS you may need to run executables with `sudo`__
Loading
Loading