-
Notifications
You must be signed in to change notification settings - Fork 2
188 lines (167 loc) · 5.59 KB
/
builds.yml
File metadata and controls
188 lines (167 loc) · 5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Build examples against latest LiveKit SDK (via CMake)
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
license-check:
name: License Check
uses: ./.github/workflows/license_check.yml
permissions:
contents: read
pin-check:
name: Pin Check
uses: ./.github/workflows/pin_check.yml
permissions:
contents: read
build:
needs:
- license-check
- pin-check
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: linux-x64
- os: macos-latest
name: macos-arm64
- os: windows-latest
name: windows-x64
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# ---------- deps ----------
- name: Install deps (Ubuntu)
if: runner.os == 'Linux'
shell: bash
run: |
set -eux
sudo apt-get update
sudo apt-get install -y \
cmake ninja-build pkg-config \
protobuf-compiler libprotobuf-dev \
libasound2-dev libpulse-dev \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev \
libxi-dev libxss-dev libxtst-dev libxkbcommon-dev \
libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev \
libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev \
libssl-dev \
libspdlog-dev \
curl
- name: Install deps (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
set -eux
brew update
brew install cmake ninja protobuf
brew install spdlog
- name: Install deps (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install -y ninja
- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: x64
# ---------- configure + build ----------
- name: Configure (Unix)
if: runner.os != 'Windows'
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -eux
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: Build (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
set -eux
cmake --build build --config Release
- name: Configure (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake -S . -B build -G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_C_COMPILER=cl `
-DCMAKE_CXX_COMPILER=cl
- name: Build (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake --build build --config Release
# ---------- smoke test ----------
- name: Smoke test (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
sdk_root="$(ls -d build/_deps/livekit-sdk/* | head -n 1)"
echo "SDK root: ${sdk_root}"
ls -la "${sdk_root}/lib" || true
# Locate executable (it may not be directly under build/)
exe="$(find build -type f -name basic_room -perm -111 | head -n 1)"
if [[ -z "${exe}" ]]; then
echo "basic_room executable not found under build/"
find build -maxdepth 3 -type f -print
exit 1
fi
echo "Running: ${exe} --self-test"
if [[ "$RUNNER_OS" == "Linux" ]]; then
export LD_LIBRARY_PATH="${sdk_root}/lib:${LD_LIBRARY_PATH:-}"
else
export DYLD_LIBRARY_PATH="${sdk_root}/lib:${DYLD_LIBRARY_PATH:-}"
fi
"${exe}" --self-test
- name: Smoke test (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
# Locate SDK root
$sdkRoot = Get-ChildItem -Directory "build/_deps/livekit-sdk" | Select-Object -First 1
if (-not $sdkRoot) {
throw "SDK root not found under build/_deps/livekit-sdk"
}
Write-Host "SDK root: $($sdkRoot.FullName)"
# Make sure DLLs are found at runtime
$env:PATH = "$($sdkRoot.FullName)\bin;$($sdkRoot.FullName)\lib;$env:PATH"
# Locate the built executable
$exe = Get-ChildItem -Recurse build -Filter basic_room.exe | Select-Object -First 1
if (-not $exe) {
throw "basic_room.exe not found in build directory"
}
Write-Host "Running $($exe.FullName) --help"
# Try to execute it. We only care that it launches.
$out = & $exe.FullName --self-test 2>&1
$code = $LASTEXITCODE
if ($code -ne 0) {
Write-Host $out
throw "basic_room.exe --self-test failed with exit code $code"
}
Write-Host $out
# ---------- upload build output ----------
- name: Upload binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: basic_room-${{ matrix.name }}
path: |
build/basic_room*
build/basic_room.exe
retention-days: 7