|
| 1 | +name: WebRTC C SDK Cross Compilation |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - develop |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - develop |
| 10 | + - main |
| 11 | +jobs: |
| 12 | + linux-cross-compilation: |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + compiler: |
| 16 | + - name: mips-32 |
| 17 | + runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable |
| 18 | + install: gcc-mips-linux-gnu g++-mips-linux-gnu |
| 19 | + cc: mips-linux-gnu-gcc |
| 20 | + cxx: mips-linux-gnu-g++ |
| 21 | + cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-mips32 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=mips-unknown-linux-gnu |
| 22 | + file-expected-output: "ELF 32-bit MSB executable, MIPS, MIPS32" |
| 23 | + - name: arm-32 |
| 24 | + runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable |
| 25 | + install: gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf |
| 26 | + cc: arm-linux-gnueabihf-gcc |
| 27 | + cxx: arm-linux-gnueabihf-g++ |
| 28 | + cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-generic32 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi |
| 29 | + file-expected-output: "ELF 32-bit LSB pie executable, ARM" |
| 30 | + - name: arm-64 |
| 31 | + runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable |
| 32 | + install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu |
| 33 | + cc: aarch64-linux-gnu-gcc |
| 34 | + cxx: aarch64-linux-gnu-g++ |
| 35 | + cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-generic64 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi |
| 36 | + file-expected-output: "ELF 64-bit LSB pie executable, ARM" |
| 37 | + - name: aarch-64 |
| 38 | + runner: public.ecr.aws/ubuntu/ubuntu:22.04_stable |
| 39 | + install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu |
| 40 | + cc: aarch64-linux-gnu-gcc |
| 41 | + cxx: aarch64-linux-gnu-g++ |
| 42 | + cmake_flags: -DBUILD_OPENSSL_PLATFORM=linux-aarch64 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi |
| 43 | + file-expected-output: "ELF 64-bit LSB pie executable, ARM" |
| 44 | + |
| 45 | + build-type: |
| 46 | + - name: Shared |
| 47 | + cmake_flags: -DBUILD_STATIC_LIBS=OFF |
| 48 | + - name: Static |
| 49 | + cmake_flags: -DBUILD_STATIC_LIBS=ON |
| 50 | + |
| 51 | + crypto: |
| 52 | + - name: OpenSSL |
| 53 | + cmake_flags: -DUSE_OPENSSL=ON -DUSE_MBEDTLS=OFF |
| 54 | + - name: MbedTLS |
| 55 | + cmake_flags: -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON |
| 56 | + |
| 57 | + threadpool: |
| 58 | + - name: Threadpool On |
| 59 | + cmake_flags: -DENABLE_KVS_THREADPOOL=ON |
| 60 | + - name: Threadpool Off |
| 61 | + cmake_flags: -DENABLE_KVS_THREADPOOL=OFF |
| 62 | + |
| 63 | + fail-fast: false |
| 64 | + runs-on: ubuntu-latest |
| 65 | + container: |
| 66 | + image: ${{ matrix.compiler.runner }} |
| 67 | + name: ${{ matrix.compiler.name }}, ${{ matrix.build-type.name }}, ${{ matrix.crypto.name }}, ${{ matrix.threadpool.name }} |
| 68 | + steps: |
| 69 | + - name: Checkout repository |
| 70 | + uses: actions/checkout@v4 |
| 71 | + - name: Install dependencies |
| 72 | + run: | |
| 73 | + apt-get update |
| 74 | + apt-get install -y build-essential cmake git pkg-config file ${{ matrix.compiler.install }} |
| 75 | + - name: Configure and build ${{ matrix.compiler.name }}, ${{ matrix.build-type.name }}, ${{ matrix.crypto.name }}, ${{ matrix.threadpool.name }} |
| 76 | + run: | |
| 77 | + export CC=${{ matrix.compiler.cc }} |
| 78 | + export CXX=${{ matrix.compiler.cxx }} |
| 79 | + echo "Using $CC and $CXX" |
| 80 | + |
| 81 | + mkdir -p build |
| 82 | + cd build |
| 83 | + |
| 84 | + cmake .. -DBUILD_TEST=ON \ |
| 85 | + -DENABLE_AWS_SDK_IN_TESTS=OFF \ |
| 86 | + ${{ matrix.build-type.cmake_flags }} \ |
| 87 | + ${{ matrix.crypto.cmake_flags }} \ |
| 88 | + ${{ matrix.compiler.cmake_flags }} \ |
| 89 | + ${{ matrix.threadpool.cmake_flags }} |
| 90 | + make -j$(sysctl -n hw.ncpu) |
| 91 | + shell: bash |
| 92 | + - name: Check test file is compiled correctly |
| 93 | + run: | |
| 94 | + cd build |
| 95 | + |
| 96 | + file ./tst/webrtc_client_test |
| 97 | + file ./samples/kvsWebrtcClientMaster |
| 98 | + |
| 99 | + readelf -a ./tst/webrtc_client_test |
| 100 | + readelf -a ./samples/kvsWebrtcClientMaster |
| 101 | + |
| 102 | + file ./tst/webrtc_client_test | grep "${{ matrix.compiler.file-expected-output }}" |
| 103 | + file ./samples/kvsWebrtcClientMaster | grep "${{ matrix.compiler.file-expected-output }}" |
| 104 | + shell: bash |
0 commit comments