-
Notifications
You must be signed in to change notification settings - Fork 3
241 lines (227 loc) · 9.46 KB
/
build-debug.yml
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: build-debug
on:
workflow_dispatch:
push:
paths-ignore:
- "examples/**"
- "**.md"
env:
TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }}
TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }}
TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }}
TEST_API_URL: ${{ secrets.TEST_API_URL }}
jobs:
build-linux:
strategy:
fail-fast: false
matrix:
platform:
- name: ubuntu-24.04_x86_64
runs-on: ubuntu-24.04
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Disk Cleanup
run: |
set -x
df -h
# sudo du -h -d1 /usr/local
# sudo du -h -d1 /usr/local/share
# sudo du -h -d1 /usr/local/lib
# sudo du -h -d1 /usr/share
RMI=`docker images -q -a`
if [ -n "$RMI" ]; then
docker rmi $RMI
fi
# 4.6G
sudo rm -rf /usr/local/.ghcup
# 1.7G
sudo rm -rf /usr/share/swift
# 1.4G
sudo rm -rf /usr/share/dotnet
# 13G
sudo rm -rf /usr/local/lib/android
df -h
- name: Get stats
run: |
set -x
cat /etc/lsb-release
uname -a
cat /proc/cpuinfo
cat /proc/meminfo
- name: Setup Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Setup common
run: |
# clang-18
wget https://apt.llvm.org/llvm.sh
chmod a+x llvm.sh
sudo ./llvm.sh 18
- uses: actions/checkout@v4
with:
path: sora-python-sdk
- name: Get versions
id: version
run: |
source sora-python-sdk/VERSION
echo "webrtc_build_version=${WEBRTC_BUILD_VERSION}" >> $GITHUB_OUTPUT
echo "sora_cpp_sdk_version=${SORA_CPP_SDK_VERSION}" >> $GITHUB_OUTPUT
echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT
# libwebrtc
- uses: actions/cache@v4
id: webrtc-build-cache
with:
path: webrtc-build/_package/${{ matrix.platform.name }}/webrtc
key: webrtc-build-${{ matrix.platform.name }}-${{ steps.version.outputs.webrtc_build_version }}
- uses: actions/checkout@v4
if: steps.webrtc-build-cache.outputs.cache-hit != 'true'
with:
path: webrtc-build
repository: shiguredo-webrtc-build/webrtc-build
ref: ${{ steps.version.outputs.webrtc_build_version }}
- name: Setup libwebrtc
if: steps.webrtc-build-cache.outputs.cache-hit != 'true'
run: |
sudo bash -c '
set -ex
apt-get -y install tzdata
echo "Asia/Tokyo" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
export DEBIAN_FRONTEND=noninteractive
apt-get -y install \
binutils \
git \
locales \
lsb-release \
ninja-build \
pkg-config \
python3 \
python3-setuptools \
rsync \
sudo \
unzip \
vim \
wget \
xz-utils
'
- name: Build libwebrtc
if: steps.webrtc-build-cache.outputs.cache-hit != 'true'
working-directory: webrtc-build
run: |
python3 run.py build --debug ${{ matrix.platform.name }}
python3 run.py package --debug ${{ matrix.platform.name }}
# sora-cpp-sdk
- uses: actions/cache@v4
id: sora-cpp-sdk-cache
with:
path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora
key: sora-cpp-sdk-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }}
- uses: actions/cache@v4
id: boost-cache
with:
path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost
key: boost-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }}
- uses: actions/checkout@v4
if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true'
with:
path: sora-cpp-sdk
repository: shiguredo/sora-cpp-sdk
ref: ${{ steps.version.outputs.sora_cpp_sdk_version }}
# Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正
# ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab
- name: Fix CUDA issues for Ubuntu 24.04
if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' && matrix.platform.name == 'ubuntu-24.04_x86_64'
run: |
sudo tee /etc/apt/sources.list.d/jammy.list << EOF
deb http://archive.ubuntu.com/ubuntu/ jammy universe
EOF
sudo tee /etc/apt/preferences.d/pin-jammy <<EOF
Package: *
Pin: release n=jammy
Pin-Priority: -10
Package: libtinfo5
Pin: release n=jammy
Pin-Priority: 990
EOF
- name: Setup sora-cpp-sdk
if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true'
working-directory: sora-cpp-sdk
run: |
source VERSION
sudo apt-get update
sudo apt-get install -y software-properties-common
# X11
sudo apt-get install libx11-dev libxext-dev
# CUDA
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_*all.deb
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION
# Intel Media SDK のために libva-dev, libdrm-dev を入れる
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev
- name: Copy libwebrtc to sora-cpp-sdk
if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true'
run: |
mkdir -p sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug
cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc
echo ${{ steps.version.outputs.webrtc_build_version }} > sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version
- name: Build sora-cpp-sdk
if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true'
working-directory: sora-cpp-sdk
run: python3 run.py --debug ${{ matrix.platform.name }}
# sora-python-sdk
- name: Setup sora-python-sdk
run: |
sudo apt-get update
sudo apt-get -y install libva2 libdrm2 libva-dev libdrm-dev libx11-dev portaudio19-dev
# Download OpneH264
curl -LO http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2
bzip2 -d libopenh264-2.4.1-linux64.7.so.bz2
mv libopenh264-2.4.1-linux64.7.so libopenh264.so
echo "OPENH264_PATH=`pwd`/libopenh264.so" >> $GITHUB_ENV
- name: Copy libwebrtc to sora-python-sdk
run: |
mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug
cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-python-sdk/_install/${{ matrix.platform.name }}/webrtc
echo ${{ steps.version.outputs.webrtc_build_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/webrtc.version
- name: Copy sora-cpp-sdk to sora-python-sdk
run: |
mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug
cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora sora-python-sdk/_install/${{ matrix.platform.name }}/sora
echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/sora.version
- name: Copy boost to sora-python-sdk
run: |
mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug
cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost sora-python-sdk/_install/${{ matrix.platform.name }}/boost
echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/boost.version
- uses: actions/cache@v4
id: llvm-cache
with:
path: sora-python-sdk/_package/${{ matrix.platform.name }}/llvm
key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }}
- uses: actions/cache@v4
id: version-file-cache
with:
path: versions
key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }}
- name: Copy version file
if: steps.version-file-cache.outputs.cache-hit == 'true'
run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/
- uses: astral-sh/setup-uv@v3
- name: Build sora-python-sdk
working-directory: sora-python-sdk
run: |
set -x
# uv python pin ${{ matrix.python_version }}
uv sync
uv run python run.py --debug ${{ matrix.platform.name }}
# cache
mkdir ../versions
cp _install/${{ matrix.platform.name }}/llvm.version ../versions
- name: E2E Test sora-python-sdk
working-directory: sora-python-sdk
run: |
lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test'