Refactor Signaling sources to make Include_i.h
independent of libwe…
#2644
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WebRTC C SDK CI | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
- 'test-pr-*' | |
pull_request: | |
branches: | |
- develop | |
- main | |
env: | |
AWS_KVS_LOG_LEVEL: 7 | |
DEBIAN_FRONTEND: noninteractive | |
jobs: | |
check-aws-credentials: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: us-west-2 | |
cleanup-old-resources: | |
needs: check-aws-credentials | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
repository: 'aws-samples/amazon-kinesis-video-streams-demos' | |
path: demos-repo | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
working-directory: ./demos-repo/python/cleanup | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Setup credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: us-west-2 | |
- name: Run cleanup script | |
working-directory: ./demos-repo/python/cleanup | |
run: | | |
python kvs_cleanup.py | |
mac-tests: | |
needs: cleanup-old-resources | |
strategy: | |
matrix: | |
os: | |
- name: Mac Intel | |
runner: macos-13 | |
- name: Mac Apple Silicon | |
runner: macos-15 | |
compiler: [ gcc, clang ] | |
config: | |
- name: Shared OpenSSL | |
cmake_flags: "-DBUILD_TEST=ON" | |
- name: Static OpenSSL | |
cmake_flags: "-DBUILD_TEST=ON -DBUILD_STATIC_LIBS=ON" | |
- name: Shared MbedTLS | |
cmake_flags: "-DBUILD_TEST=ON -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON" | |
- name: Static MbedTLS | |
cmake_flags: "-DBUILD_TEST=ON -DBUILD_STATIC_LIBS=ON -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON" | |
fail-fast: false | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ${{ matrix.os.runner }} | |
name: ${{ matrix.os.name }}, ${{ matrix.compiler }}, ${{ matrix.config.name }} | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.x' | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Install GStreamer | |
run: | | |
brew install gstreamer | |
- name: Configure and build ${{ matrix.config.name }} | |
run: | | |
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then | |
export CC="gcc-14" | |
export CXX="g++-14" | |
else | |
export CC="clang" | |
export CXX="clang++" | |
fi | |
echo "Using CC: $CC and CXX: $CXX" | |
mkdir -p build | |
cd build | |
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then | |
# Skip building the tests for Mac with GCC | |
# https://github.com/awslabs/aws-crt-cpp/issues/605 | |
cmake .. ${{ matrix.config.cmake_flags }} -DENABLE_AWS_SDK_IN_TESTS=OFF | |
else | |
cmake .. ${{ matrix.config.cmake_flags }} | |
fi | |
make -j$(sysctl -n hw.ncpu) | |
shell: bash | |
- name: Run tests | |
working-directory: ./build | |
run: | | |
./tst/webrtc_client_test | |
shell: bash | |
# linux-gcc-4_4: | |
# runs-on: ubuntu-20.04 | |
# env: | |
# AWS_KVS_LOG_LEVEL: 2 | |
# CC: gcc-4.4 | |
# permissions: | |
# id-token: write | |
# contents: read | |
# steps: | |
# - name: Clone repository | |
# uses: actions/checkout@v4 | |
# - name: Configure AWS Credentials | |
# uses: aws-actions/configure-aws-credentials@v4 | |
# with: | |
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
# aws-region: ${{ secrets.AWS_REGION }} | |
# - name: Install deps | |
# run: | | |
# sudo apt clean && sudo apt update | |
# sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' | |
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
# sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty main' | |
# sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty universe' | |
# sudo apt-get -q update | |
# sudo apt-get -y install gcc-4.4 | |
# sudo apt-get -y install gdb | |
# sudo apt-get -y install libcurl4-openssl-dev | |
# - name: Setup cmake | |
# uses: jwlawson/actions-setup-cmake@v2 | |
# with: | |
# cmake-version: '3.x' | |
# - name: Build repository | |
# run: | | |
# mkdir build && cd build | |
# # As per REAMDE here: https://github.com/aws/aws-sdk-cpp minimum supported GCC is 4.9 so we do not run those tests here | |
# cmake .. -DBUILD_TEST=TRUE -DENABLE_AWS_SDK_IN_TESTS=OFF | |
# make | |
# ulimit -c unlimited -S | |
# - name: Run tests | |
# run: | | |
# cd build | |
# timeout --signal=SIGABRT 60m ./tst/webrtc_client_test | |
static-build-alpine-linux: | |
runs-on: ubuntu-22.04 | |
container: | |
image: alpine:3.15.4 | |
env: | |
CC: gcc | |
CXX: g++ | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
apk update | |
apk upgrade | |
apk add alpine-sdk cmake clang linux-headers perl bash openssl-dev zlib-dev curl-dev | |
- name: Build Repository | |
run: | | |
mkdir build && cd build | |
cmake .. -DBUILD_STATIC_LIBS=TRUE -DBUILD_TEST=TRUE | |
make -j | |
mbedtls-ubuntu-gcc-4-4: | |
needs: cleanup-old-resources | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest | |
container: public.ecr.aws/ubuntu/ubuntu:20.04_stable | |
timeout-minutes: 60 | |
env: | |
CC: gcc-4.4 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: | | |
apt-get update | |
apt-get install -y software-properties-common cmake git pkg-config build-essential | |
add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty main' | |
add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty universe' | |
apt-get -q update | |
apt-get -y install gcc-4.4 | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.x' | |
- name: Build repository | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DBUILD_TEST=ON -DENABLE_AWS_SDK_IN_TESTS=OFF -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON | |
make -j | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Run tests | |
run: | | |
cd build | |
timeout --signal=SIGABRT 60m ./tst/webrtc_client_test | |
ubuntu: | |
needs: cleanup-old-resources | |
strategy: | |
matrix: | |
container: | |
- name: Ubuntu 20.04 | |
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable | |
- name: Ubuntu 22.04 | |
image: public.ecr.aws/ubuntu/ubuntu:22.04_stable | |
test: ON | |
compiler: | |
- gcc | |
- clang | |
build-configuration: | |
- name: curl | |
cmake-args: "-DUSE_OPENSSL=ON -DUSE_MBEDTLS=OFF" | |
- name: lws | |
cmake-args: "-DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON" | |
fail-fast: false | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ matrix.container.image }} | |
permissions: | |
id-token: write | |
contents: read | |
name: ${{ matrix.container.name }}-${{ matrix.compiler }}-${{ matrix.build-configuration.name }} | |
timeout-minutes: 60 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install -y git cmake build-essential pkg-config file | |
- name: Setup GCC | |
if: ${{ matrix.compiler == 'gcc' }} | |
run: | | |
gcc --version | |
echo "CC=gcc" >> $GITHUB_ENV | |
echo "CXX=g++" >> $GITHUB_ENV | |
- name: Setup Clang | |
if: ${{ matrix.compiler == 'clang' }} | |
run: | | |
apt-get -y install clang | |
clang --version | |
echo "CC=clang" >> $GITHUB_ENV | |
echo "CXX=clang++" >> $GITHUB_ENV | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.x' | |
- name: Build repository | |
run: | | |
mkdir build && cd build | |
cmake .. -DBUILD_TEST=ON -DENABLE_AWS_SDK_IN_TESTS=OFF ${{ matrix.build-configuration.cmake-args }} | |
make -j | |
file ./tst/webrtc_client_test | |
- name: Configure AWS Credentials | |
if: ${{ matrix.container.test == 'ON' }} | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Run tests | |
# Don't run all the tests multiple times for each configuration (duplicate) | |
if: ${{ matrix.container.test == 'ON' }} | |
working-directory: ./build | |
run: | | |
./tst/webrtc_client_test | |
windows-msvc-openssl: | |
needs: cleanup-old-resources | |
runs-on: windows-2022 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Move cloned repo | |
shell: powershell | |
run: | | |
mkdir C:\webrtc | |
Move-Item -Path "D:\a\amazon-kinesis-video-streams-webrtc-sdk-c\amazon-kinesis-video-streams-webrtc-sdk-c\*" -Destination "C:\webrtc" | |
- name: Install dependencies | |
shell: powershell | |
run: | | |
choco install pkgconfiglite | |
choco install gstreamer --version=1.16.3 | |
choco install gstreamer-devel --version=1.16.3 | |
curl.exe -o C:\tools\pthreads-w32-2-9-1-release.zip ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip | |
mkdir C:\tools\pthreads-w32-2-9-1-release\ | |
Expand-Archive -Path C:\tools\pthreads-w32-2-9-1-release.zip -DestinationPath C:\tools\pthreads-w32-2-9-1-release | |
# - name: Build libwebsockets from source | |
# shell: powershell | |
# run: | | |
# $env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\a\amazon-kinesis-video-streams-webrtc-sdk-c\amazon-kinesis-video-streams-webrtc-sdk-c\open-source\bin;C:\tools\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64;C:\tools\pthreads-w32-2-9-1-release\Pre-built.2\include' | |
# git config --system core.longpaths true | |
# cd C:\tools\ | |
# git clone https://github.com/warmcat/libwebsockets.git | |
# git checkout v4.2.2 | |
# cd libwebsockets | |
# mkdir build | |
# cd build | |
# cmake .. -DLWS_HAVE_PTHREAD_H=1 -DLWS_EXT_PTHREAD_INCLUDE_DIR="C:\\tools\\pthreads-w32-2-9-1-release\\Pre-built.2\\include" -DLWS_EXT_PTHREAD_LIBRARIES="C:\\tools\\pthreads-w32-2-9-1-release\\Pre-built.2\\lib\\x64\\libpthreadGC2.a" -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_OPENSSL_INCLUDE_DIRS="C:\\Program Files\\OpenSSL\\include" -DLWS_OPENSSL_LIBRARIES="C:\\Program Files\\OpenSSL\\lib\\libssl.lib;C:\\Program Files\\OpenSSL\\lib\\libcrypto.lib" | |
# cmake --build . --config DEBUG | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.x' | |
- name: Build repository | |
shell: powershell | |
run: | | |
cd C:\webrtc | |
git config --system core.longpaths true | |
.github\build_windows_openssl.bat | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Run tests | |
shell: powershell | |
run: | | |
$env:Path += ';C:\webrtc\open-source\bin;C:\tools\pthreads-w32-2-9-1-release\Pre-built.2\dll\x64;C:\webrtc\build' | |
& "C:\webrtc\build\tst\webrtc_client_test.exe" --gtest_filter="-SignalingApiFunctionalityTest.receivingIceConfigOffer_SlowClockSkew:SignalingApiFunctionalityTest.iceServerConfigRefreshConnectedAuthExpiration:SignalingApiFunctionalityTest.receivingIceConfigOffer_FastClockSkew:SignalingApiFunctionalityTest.receivingIceConfigOffer_FastClockSkew_VerifyOffsetRemovedWhenClockFixed:DataChannelFunctionalityTest.*:DtlsApiTest.*:IceApiTest.*:IceFunctionalityTest.*:PeerConnectionFunctionalityTest.*:TurnConnectionFunctionalityTest.*:RtpFunctionalityTest.marshallUnmarshallH264Data:RtpFunctionalityTest.packingUnpackingVerifySameH264Frame:RtpFunctionalityTest.packingUnpackingVerifySameH265Frame:RtcpFunctionalityTest.onRtcpPacketCompound:RtcpFunctionalityTest.twcc3" | |
# windows-msvc-mbedtls: | |
# runs-on: windows-2022 | |
# env: | |
# AWS_KVS_LOG_LEVEL: 7 | |
# steps: | |
# - name: Clone repository | |
# uses: actions/checkout@v4 | |
# - name: Move cloned repo | |
# shell: powershell | |
# run: | | |
# mkdir D:\a\webrtc | |
# Move-Item -Path "D:\a\amazon-kinesis-video-streams-webrtc-sdk-c\amazon-kinesis-video-streams-webrtc-sdk-c\*" -Destination "D:\a\webrtc" | |
# cd D:\a\webrtc | |
# dir | |
# - name: Install dependencies | |
# shell: powershell | |
# run: | | |
# choco install gstreamer --version=1.16.2 | |
# choco install gstreamer-devel --version=1.16.2 | |
# curl.exe -o C:\tools\pthreads-w32-2-9-1-release.zip ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip | |
# mkdir C:\tools\pthreads-w32-2-9-1-release\ | |
# Expand-Archive -Path C:\tools\pthreads-w32-2-9-1-release.zip -DestinationPath C:\tools\pthreads-w32-2-9-1-release | |
# - name: Build repository | |
# shell: powershell | |
# run: | | |
# cd D:\a\webrtc | |
# git config --system core.longpaths true | |
# .github\build_windows_mbedtls.bat | |
# ---------------------------------------------------- | |
stats-calc-control-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.x' | |
- name: Build repository | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DBUILD_TEST=ON -DENABLE_STATS_CALCULATION_CONTROL=ON -DENABLE_AWS_SDK_IN_TESTS=OFF | |
make -j | |
- name: Run tests | |
working-directory: ./build | |
run: | | |
./tst/webrtc_client_test --gtest_filter="*MetricsApiTest*" | |
stack-size-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.x' | |
- name: Check StackSize with Invalid Value | |
run: | | |
mkdir build | |
cd build | |
set +e # Allow the script to continue even if cmake fails (expected) | |
cmake .. -DKVS_STACK_SIZE=65536asdfsadf | |
cmake_exit_code=$? | |
set -e | |
if [ $cmake_exit_code -eq 0 ]; then | |
echo "CMake unexpectedly succeeded with invalid KVS_STACK_SIZE" | |
exit 1 | |
fi | |
- name: Check Stack Size is Set | |
working-directory: ./build | |
run: | | |
CMAKE_LOGS=$(cmake .. -DKVS_STACK_SIZE=65536 -DBUILD_SAMPLE=OFF 2>&1) | |
if ! echo "$CMAKE_LOGS" | grep -q "Building with default stack size: 65536 bytes"; then | |
echo "Stack size was not sent to PIC properly. See the logs below:" | |
echo "$CMAKE_LOGS" | |
exit 1 | |
fi |