|
| 1 | +name: formatter |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - "doc/**" |
| 7 | + - "**.md" |
| 8 | + - "LICENSE" |
| 9 | + - "NOTICE" |
| 10 | + |
| 11 | +jobs: |
| 12 | + run-ubuntu: |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + platform: |
| 17 | + - name: ubuntu-24.04_x86_64 |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + os: ubuntu |
| 20 | + arch: x86_64 |
| 21 | + name: Build sora-cpp-sdk for ${{ matrix.platform.name }} |
| 22 | + runs-on: ${{ matrix.platform.runs-on }} |
| 23 | + env: |
| 24 | + TEST_SIGNALING_URL: ${{ secrets.TEST_SIGNALING_URL }} |
| 25 | + TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} |
| 26 | + TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} |
| 27 | + TEST_MATRIX_NAME: ${{ matrix.platform.name }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + # IWYU を適用するにはまずビルドする必要がある |
| 31 | + # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 |
| 32 | + # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab |
| 33 | + - name: Fix CUDA issues for Ubuntu 24.04 |
| 34 | + if: matrix.platform.name == 'ubuntu-24.04_x86_64' |
| 35 | + run: | |
| 36 | + sudo tee /etc/apt/sources.list.d/jammy.list << EOF |
| 37 | + deb http://archive.ubuntu.com/ubuntu/ jammy universe |
| 38 | + EOF |
| 39 | +
|
| 40 | + sudo tee /etc/apt/preferences.d/pin-jammy <<EOF |
| 41 | + Package: * |
| 42 | + Pin: release n=jammy |
| 43 | + Pin-Priority: -10 |
| 44 | +
|
| 45 | + Package: libtinfo5 |
| 46 | + Pin: release n=jammy |
| 47 | + Pin-Priority: 990 |
| 48 | + EOF |
| 49 | + - name: Install deps for ${{ matrix.platform.name }} |
| 50 | + if: matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64' |
| 51 | + run: | |
| 52 | + source VERSION |
| 53 | + sudo apt-get update |
| 54 | + sudo apt-get install -y software-properties-common |
| 55 | +
|
| 56 | + # X11 |
| 57 | + sudo apt-get install libx11-dev libxext-dev |
| 58 | +
|
| 59 | + # OpenGL |
| 60 | + sudo apt-get install -y libgl-dev |
| 61 | +
|
| 62 | + # CUDA |
| 63 | + # libssl1.1 が必要 |
| 64 | + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb |
| 65 | + sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb |
| 66 | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb |
| 67 | + sudo dpkg -i cuda-keyring_*all.deb |
| 68 | + sudo apt-get update |
| 69 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION |
| 70 | +
|
| 71 | + # clang-20 |
| 72 | + wget https://apt.llvm.org/llvm.sh |
| 73 | + chmod a+x llvm.sh |
| 74 | + sudo ./llvm.sh 20 |
| 75 | + - run: python3 run.py build --test ${{ matrix.platform.name }} |
| 76 | + - name: Build Examples |
| 77 | + run: | |
| 78 | + cd examples |
| 79 | + mkdir examples_${{ matrix.platform.name }} |
| 80 | + for app in sdl_sample sumomo messaging_recvonly_sample; do |
| 81 | + python3 $app/${{ matrix.platform.name }}/run.py --local-sora-cpp-sdk-dir .. |
| 82 | + done |
| 83 | + if: matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-22.04_armv8' |
| 84 | + - name: Run IWYU |
| 85 | + run: python3 run.py iwyu ubuntu-24.04_x86_64 || git diff --exit-code |
| 86 | + - name: Run clang format |
| 87 | + run: python3 run.py format || git diff --exit-code |
| 88 | + - name: Check diff |
| 89 | + run: git diff --exit-code |
| 90 | + |
| 91 | + notification: |
| 92 | + name: Slack Notification |
| 93 | + runs-on: ubuntu-24.04 |
| 94 | + needs: |
| 95 | + - run-ubuntu |
| 96 | + if: always() |
| 97 | + steps: |
| 98 | + - uses: rtCamp/action-slack-notify@v2 |
| 99 | + if: | |
| 100 | + needs.run-ubuntu.result == 'failure' |
| 101 | + env: |
| 102 | + SLACK_CHANNEL: sora-cpp-sdk |
| 103 | + SLACK_COLOR: danger |
| 104 | + SLACK_TITLE: Build failed |
| 105 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
0 commit comments