|
| 1 | +name: build-relwithdebinfo |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + paths-ignore: |
| 7 | + - "examples/**" |
| 8 | + - "**.md" |
| 9 | + |
| 10 | +env: |
| 11 | + TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }} |
| 12 | + TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} |
| 13 | + TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} |
| 14 | + TEST_API_URL: ${{ secrets.TEST_API_URL }} |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-linux: |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + platform: |
| 22 | + - name: ubuntu-24.04_x86_64 |
| 23 | + runs-on: ubuntu-24.04 |
| 24 | + runs-on: ${{ matrix.platform.runs-on }} |
| 25 | + steps: |
| 26 | + - name: Disk Cleanup |
| 27 | + run: | |
| 28 | + set -x |
| 29 | + df -h |
| 30 | + # sudo du -h -d1 /usr/local |
| 31 | + # sudo du -h -d1 /usr/local/share |
| 32 | + # sudo du -h -d1 /usr/local/lib |
| 33 | + # sudo du -h -d1 /usr/share |
| 34 | + RMI=`docker images -q -a` |
| 35 | + if [ -n "$RMI" ]; then |
| 36 | + docker rmi $RMI |
| 37 | + fi |
| 38 | + # 4.6G |
| 39 | + sudo rm -rf /usr/local/.ghcup |
| 40 | + # 1.7G |
| 41 | + sudo rm -rf /usr/share/swift |
| 42 | + # 1.4G |
| 43 | + sudo rm -rf /usr/share/dotnet |
| 44 | + # 13G |
| 45 | + sudo rm -rf /usr/local/lib/android |
| 46 | + df -h |
| 47 | + - name: Get stats |
| 48 | + run: | |
| 49 | + set -x |
| 50 | + cat /etc/lsb-release |
| 51 | + uname -a |
| 52 | + cat /proc/cpuinfo |
| 53 | + cat /proc/meminfo |
| 54 | + - name: Setup Git User |
| 55 | + run: | |
| 56 | + git config --global user.name "${{ github.actor }}" |
| 57 | + git config --global user.email "${{ github.actor }}@users.noreply.github.com" |
| 58 | +
|
| 59 | + - name: Setup common |
| 60 | + run: | |
| 61 | + # clang-18 |
| 62 | + wget https://apt.llvm.org/llvm.sh |
| 63 | + chmod a+x llvm.sh |
| 64 | + sudo ./llvm.sh 18 |
| 65 | +
|
| 66 | + - uses: actions/checkout@v4 |
| 67 | + with: |
| 68 | + path: sora-python-sdk |
| 69 | + - name: Get versions |
| 70 | + id: version |
| 71 | + run: | |
| 72 | + source sora-python-sdk/VERSION |
| 73 | + echo "webrtc_build_version=${WEBRTC_BUILD_VERSION}" >> $GITHUB_OUTPUT |
| 74 | + echo "sora_cpp_sdk_version=${SORA_CPP_SDK_VERSION}" >> $GITHUB_OUTPUT |
| 75 | + echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT |
| 76 | +
|
| 77 | + # sora-cpp-sdk |
| 78 | + - uses: actions/cache@v4 |
| 79 | + id: sora-cpp-sdk-cache |
| 80 | + with: |
| 81 | + path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/sora |
| 82 | + key: sora-cpp-sdk-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }}-relwithdebinfo |
| 83 | + - uses: actions/cache@v4 |
| 84 | + id: boost-cache |
| 85 | + with: |
| 86 | + path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/boost |
| 87 | + key: boost-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }}-relwithdebinfo |
| 88 | + - uses: actions/checkout@v4 |
| 89 | + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' |
| 90 | + with: |
| 91 | + path: sora-cpp-sdk |
| 92 | + repository: shiguredo/sora-cpp-sdk |
| 93 | + ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} |
| 94 | + # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 |
| 95 | + # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab |
| 96 | + - name: Fix CUDA issues for Ubuntu 24.04 |
| 97 | + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' && matrix.platform.name == 'ubuntu-24.04_x86_64' |
| 98 | + run: | |
| 99 | + sudo tee /etc/apt/sources.list.d/jammy.list << EOF |
| 100 | + deb http://archive.ubuntu.com/ubuntu/ jammy universe |
| 101 | + EOF |
| 102 | +
|
| 103 | + sudo tee /etc/apt/preferences.d/pin-jammy <<EOF |
| 104 | + Package: * |
| 105 | + Pin: release n=jammy |
| 106 | + Pin-Priority: -10 |
| 107 | +
|
| 108 | + Package: libtinfo5 |
| 109 | + Pin: release n=jammy |
| 110 | + Pin-Priority: 990 |
| 111 | + EOF |
| 112 | + - name: Setup sora-cpp-sdk |
| 113 | + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' |
| 114 | + working-directory: sora-cpp-sdk |
| 115 | + run: | |
| 116 | + source VERSION |
| 117 | + sudo apt-get update |
| 118 | + sudo apt-get install -y software-properties-common |
| 119 | +
|
| 120 | + # X11 |
| 121 | + sudo apt-get install libx11-dev libxext-dev |
| 122 | +
|
| 123 | + # CUDA |
| 124 | + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb |
| 125 | + sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb |
| 126 | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb |
| 127 | + sudo dpkg -i cuda-keyring_*all.deb |
| 128 | + sudo apt-get update |
| 129 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION |
| 130 | +
|
| 131 | + # Intel Media SDK のために libva-dev, libdrm-dev を入れる |
| 132 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev |
| 133 | + - name: Build sora-cpp-sdk |
| 134 | + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' |
| 135 | + working-directory: sora-cpp-sdk |
| 136 | + run: python3 run.py --relwithdebinfo ${{ matrix.platform.name }} |
| 137 | + |
| 138 | + # sora-python-sdk |
| 139 | + - name: Setup sora-python-sdk |
| 140 | + run: | |
| 141 | + sudo apt-get update |
| 142 | + sudo apt-get -y install libva2 libdrm2 libva-dev libdrm-dev libx11-dev portaudio19-dev |
| 143 | +
|
| 144 | + # Download OpneH264 |
| 145 | + curl -LO http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2 |
| 146 | + bzip2 -d libopenh264-2.4.1-linux64.7.so.bz2 |
| 147 | + mv libopenh264-2.4.1-linux64.7.so libopenh264.so |
| 148 | + echo "OPENH264_PATH=`pwd`/libopenh264.so" >> $GITHUB_ENV |
| 149 | + - name: Copy sora-cpp-sdk to sora-python-sdk |
| 150 | + run: | |
| 151 | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/release |
| 152 | + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/sora sora-python-sdk/_install/${{ matrix.platform.name }}/sora |
| 153 | + echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/sora.version |
| 154 | + - name: Copy boost to sora-python-sdk |
| 155 | + run: | |
| 156 | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/release |
| 157 | + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/boost sora-python-sdk/_install/${{ matrix.platform.name }}/boost |
| 158 | + echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/boost.version |
| 159 | + - uses: actions/cache@v4 |
| 160 | + id: llvm-cache |
| 161 | + with: |
| 162 | + path: sora-python-sdk/_install/${{ matrix.platform.name }}/llvm |
| 163 | + key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} |
| 164 | + - uses: actions/cache@v4 |
| 165 | + id: version-file-cache |
| 166 | + with: |
| 167 | + path: versions |
| 168 | + key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} |
| 169 | + - name: Copy version file |
| 170 | + if: steps.version-file-cache.outputs.cache-hit == 'true' |
| 171 | + run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/ |
| 172 | + - uses: astral-sh/setup-uv@v3 |
| 173 | + - name: Build sora-python-sdk |
| 174 | + working-directory: sora-python-sdk |
| 175 | + run: | |
| 176 | + set -x |
| 177 | + # uv python pin ${{ matrix.python_version }} |
| 178 | + uv sync |
| 179 | + uv run python run.py --relwithdebinfo ${{ matrix.platform.name }} |
| 180 | + # cache |
| 181 | + mkdir -p ../versions |
| 182 | + cp _install/${{ matrix.platform.name }}/llvm.version ../versions |
| 183 | + - name: E2E Test sora-python-sdk |
| 184 | + working-directory: sora-python-sdk |
| 185 | + run: | |
| 186 | + for i in {1..10}; do |
| 187 | + echo "---------------- $i 回目 ----------------" |
| 188 | + sleep 10 |
| 189 | + lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' |
| 190 | + done |
0 commit comments