Skip to content

Do not leak Sendable extensions to consumers #846

Do not leak Sendable extensions to consumers

Do not leak Sendable extensions to consumers #846

Workflow file for this run

name: CI
permissions:
contents: read
pull-requests: write
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
TEST_TARGETS: "LiveKitCoreTests LiveKitObjCTests"
TEST_TIMEOUT_MINUTES: 15
TEST_RETRY_ATTEMPTS: 3
jobs:
build-and-test:
name: Build & Test
strategy:
fail-fast: false
matrix:
include:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
- os: macos-14
xcode: 15.4
platform: "iOS Simulator,name=iPhone 15 Pro,OS=17.5"
- os: macos-14
xcode: 15.4
platform: "macOS"
- os: macos-14
xcode: 15.4
platform: "macOS,variant=Mac Catalyst"
- os: macos-14
xcode: 15.4
platform: "tvOS Simulator,name=Apple TV,OS=17.5"
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
- os: macos-15
xcode: 16.4
platform: "iOS Simulator,name=iPhone 16 Pro,OS=18.5"
- os: macos-15
xcode: 16.4
platform: "macOS"
- os: macos-15
xcode: 16.4
platform: "macOS,variant=Mac Catalyst"
- os: macos-15
xcode: 16.4
platform: "visionOS Simulator,name=Apple Vision Pro,OS=2.5"
- os: macos-15
xcode: 16.4
platform: "tvOS Simulator,name=Apple TV,OS=18.5"
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
- os: macos-26
xcode: latest
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.1"
symbol-graph: true
- os: macos-26
xcode: latest
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.1"
extension-api-only: true
- os: macos-26
xcode: latest
platform: "macOS"
symbol-graph: true
- os: macos-26
xcode: latest
platform: "macOS"
asan: true
- os: macos-26
xcode: latest
platform: "macOS"
tsan: true
- os: macos-26
xcode: latest
platform: "macOS,variant=Mac Catalyst"
- os: macos-26
xcode: latest
platform: "visionOS Simulator,name=Apple Vision Pro,OS=26.1"
- os: macos-26
xcode: latest
platform: "tvOS Simulator,name=Apple TV,OS=26.1"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install LiveKit Server
run: brew install livekit
- name: Run LiveKit Server
run: livekit-server --dev &
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Xcode Version
run: xcodebuild -version
- name: Swift Version
run: xcrun swift --version
- name: Build for Testing
run: |
set -o pipefail && xcodebuild build-for-testing \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' \
-enableAddressSanitizer ${{ matrix.asan == true && 'YES' || 'NO' }} \
-enableThreadSanitizer ${{ matrix.tsan == true && 'YES' || 'NO' }} \
APPLICATION_EXTENSION_API_ONLY=${{ matrix.extension-api-only == true && 'YES' || 'NO' }} \
| xcbeautify --renderer github-actions
- name: Run Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: ${{ env.TEST_TIMEOUT_MINUTES }}
max_attempts: ${{ env.TEST_RETRY_ATTEMPTS }}
command: |
set -euo pipefail
IFS=' ' read -r -a tests <<< "${{ env.TEST_TARGETS }}"
for test in "${tests[@]}"; do
echo "::group::$test"
if ! xcodebuild test-without-building \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' \
-enableAddressSanitizer ${{ matrix.asan == true && 'YES' || 'NO' }} \
-enableThreadSanitizer ${{ matrix.tsan == true && 'YES' || 'NO' }} \
APPLICATION_EXTENSION_API_ONLY=${{ matrix.extension-api-only == true && 'YES' || 'NO' }} \
-only-testing:$test \
-parallel-testing-enabled NO \
| xcbeautify --renderer github-actions
then
echo "::error::Test failed: $test"
exit 1
fi
echo "::endgroup::"
done
- name: Build for Release
if: ${{ matrix.symbol-graph }}
run: |
set -o pipefail && xcodebuild build\
-scheme LiveKit \
-configuration Release \
-destination 'platform=${{ matrix.platform }}' \
APPLICATION_EXTENSION_API_ONLY=${{ matrix.extension-api-only == true && 'YES' || 'NO' }} \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS="-Xfrontend -emit-symbol-graph\
-Xfrontend -emit-symbol-graph-dir\
-Xfrontend \"${PWD}/symbol-graph\"" \
DOCC_EXTRACT_EXTENSION_SYMBOLS=YES | xcbeautify --renderer github-actions
- name: Upload Symbol Graph
if: ${{ matrix.symbol-graph }}
uses: actions/upload-artifact@v4
with:
name: symbol-graph-${{ matrix.platform }}
path: symbol-graph
retention-days: 1
lint:
name: Lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: SwiftFormat Lint
run: swiftformat --lint . --reporter github-actions-log
# Comes pre-installed on macOS runners
build-docs:
name: Build Docs
needs: build-and-test
if: always()
runs-on: macos-15
steps:
- name: Checkout Documentation Catalog
uses: actions/checkout@v4
with:
sparse-checkout: Sources/LiveKit/LiveKit.docc
- name: Download Symbol Graphs
uses: actions/download-artifact@v4
with:
pattern: symbol-graph-*
path: symbol-graphs
- name: List Symbol Graphs
run: cd symbol-graphs && ls -al
- name: Build Docs
run: |
$(xcrun --find docc) convert \
Sources/LiveKit/LiveKit.docc \
--output-dir docs \
--additional-symbol-graph-dir symbol-graphs \
--transform-for-static-hosting \
--hosting-base-path /reference/client-sdk-swift/
- name: Archive
run: zip -r docs.zip docs
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: docs
path: docs.zip
retention-days: 1
check-protocol:
name: Check Protocol
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install swift-protobuf
run: brew install protobuf swift-protobuf
- name: Generate Swift protobuf files
run: make proto
- name: Check working tree
run: |
if ! git diff --quiet; then
echo "::error::Working tree is not clean after running 'make proto'"
echo "The following files have been modified:"
git diff --name-only
echo ""
echo "Please run 'make proto' locally and commit the changes."
exit 1
else
echo "Working tree is clean - all Swift protobuf files are up to date"
fi
check-changes:
name: Check Changes
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for .changes files
id: check-changes
run: |
if [ -z "$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '^\.changes/')" ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Comment on PR
if: steps.check-changes.outputs.has_changes == 'false'
uses: mshick/add-pr-comment@v2
with:
message: |
⚠️ This PR does not contain any files in the `.changes` directory.
repo-token: ${{ secrets.GITHUB_TOKEN }}