From 116f4d0bba81063488f05db43b51a692c367534c Mon Sep 17 00:00:00 2001 From: sirknightj Date: Thu, 6 Feb 2025 00:21:19 -0800 Subject: [PATCH] Adding sample checks --- .github/workflows/ci.yml | 832 +++++++++---------- .github/workflows/codeql-analysis.yml | 128 +-- .github/workflows/raspberry-pi.yaml | 186 ++--- .github/workflows/samples.yml | 172 ++++ samples/kvs_gstreamer_audio_video_sample.cpp | 2 +- 5 files changed, 746 insertions(+), 574 deletions(-) create mode 100644 .github/workflows/samples.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f0a62f..ef2f8740 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,416 +1,416 @@ -name: Producer CPP SDK CI - -on: - push: - branches: - - develop - - master - pull_request: - branches: - - develop - - master - -jobs: - mac-os-build-clang: - runs-on: macos-13 - env: - AWS_KVS_LOG_LEVEL: 2 - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - brew install pkg-config openssl cmake gstreamer log4cplus - brew unlink openssl - - name: Build repository - run: | - mkdir build && cd build - sh -c 'cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE;cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE -DCMAKE_INSTALL_PREFIX=.' - make - make install - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ./tst/producerTest - - mac-os-build-gcc: - runs-on: macos-13 - permissions: - id-token: write - contents: read - env: - CC: gcc - CXX: g++ - AWS_KVS_LOG_LEVEL: 2 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - brew install pkg-config openssl cmake gstreamer log4cplus - brew unlink openssl - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DCMAKE_INSTALL_PREFIX=. - make - make install - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ./tst/producerTest - - linux-gcc-code-coverage: - runs-on: ubuntu-20.04 - env: - AWS_KVS_LOG_LEVEL: 2 - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. - make - make install - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 60m ./tst/producerTest - - name: Code coverage - run: | - cd build - for test_file in $(find CMakeFiles/KinesisVideoProducer.dir gstkvssink.dir KinesisVideoProducerJNI.dir -name '*.gcno'); do gcov $test_file; done - bash <(curl -s https://codecov.io/bash) - - address-sanitizer: - runs-on: ubuntu-20.04 - permissions: - id-token: write - contents: read - env: - CC: clang - CXX: clang++ - AWS_KVS_LOG_LEVEL: 2 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. - make - make install - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 60m ./tst/producerTest - - undefined-behavior-sanitizer: - runs-on: ubuntu-20.04 - permissions: - id-token: write - contents: read - env: - CC: clang - CXX: clang++ - AWS_KVS_LOG_LEVEL: 2 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. - make - make install - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 60m ./tst/producerTest - - # memory-sanitizer: - # runs-on: ubuntu-20.04 - # permissions: - # id-token: write - # contents: read - # env: - # CC: clang - # CXX: clang++ - # AWS_KVS_LOG_LEVEL: 2 - # steps: - # - name: Clone repository - # uses: actions/checkout@v3 - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1-node16 - # with: - # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - # role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - # aws-region: ${{ secrets.AWS_REGION }} - # - name: Build repository - # run: | - # mkdir build && cd build - # cmake .. -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE - # make - # ulimit -c unlimited -S - # timeout --signal=SIGABRT 150m ./tst/producerTest --gtest_break_on_failure - # thread-sanitizer: - # runs-on: ubuntu-20.04 - # permissions: - # id-token: write - # contents: read - # env: - # CC: clang - # CXX: clang++ - # AWS_KVS_LOG_LEVEL: 2 - # steps: - # - name: Clone repository - # uses: actions/checkout@v3 - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1-node16 - # with: - # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - # role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - # aws-region: ${{ secrets.AWS_REGION }} - # - name: Build repository - # run: | - # sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - # mkdir build && cd build - # cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE - # make - # ulimit -c unlimited -S - # timeout --signal=SIGABRT 20m ./tst/producerTest - - ubuntu-gcc: - runs-on: ubuntu-20.04 - env: - AWS_KVS_LOG_LEVEL: 2 - CC: gcc - CXX: g++ - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. - make - make install - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 60m ./tst/producerTest - - windows-msvc: - runs-on: windows-2022 - env: - AWS_KVS_LOG_LEVEL: 7 - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Move repository - run: | - mkdir C:\producer - Move-Item -Path "D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\*" -Destination "D:\producer" - - name: Install dependencies - run: | - choco install nasm strawberryperl - choco install gstreamer --version=1.22.8 - choco install gstreamer-devel --version=1.22.8 - - name: Build repository - run: | - $env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin' - git config --system core.longpaths true - cd D:\producer - dir - .\build_windows.bat - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - $env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin' - & "D:\producer\build\tst\producerTest.exe" - - arm64-cross-compilation: - runs-on: ubuntu-20.04 - env: - CC: aarch64-linux-gnu-gcc - CXX: aarch64-linux-gnu-g++ - steps: - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Clone repository - uses: actions/checkout@v3 - - name: Build Repository - run: | - sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic64 -DBUILD_LOG4CPLUS_HOST=arm-linux -DCMAKE_INSTALL_PREFIX=. - make - make install - file libKinesisVideoProducer.so - - linux-aarch64-cross-compilation: - runs-on: ubuntu-20.04 - env: - CC: aarch64-linux-gnu-gcc - CXX: aarch64-linux-gnu-g++ - steps: - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Clone repository - uses: actions/checkout@v3 - - name: Build Repository - run: | - sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DBUILD_OPENSSL_PLATFORM=linux-aarch64 -DBUILD_LOG4CPLUS_HOST=arm-linux -DCMAKE_INSTALL_PREFIX=. - make - make install - file libKinesisVideoProducer.so - - arm32-cross-compilation: - runs-on: ubuntu-20.04 - env: - CC: arm-linux-gnueabi-gcc - CXX: arm-linux-gnueabi-g++ - steps: - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get -y install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi - sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Clone repository - uses: actions/checkout@v3 - - name: Build Repository - run: | - sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic32 -DBUILD_LOG4CPLUS_HOST=arm-linux -DCMAKE_INSTALL_PREFIX=. - make - make install - file libKinesisVideoProducer.so - - linux-build-gcc-static: - runs-on: ubuntu-20.04 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_STATIC=ON - make - - linux-build-gcc-shared: - runs-on: ubuntu-20.04 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt clean && sudo apt update - sudo apt install -y libunwind-dev - sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_DEPENDENCIES=OFF -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_STATIC=OFF -DBUILD_SHARED_LIBS=ON - make +#name: Producer CPP SDK CI +# +#on: +# push: +# branches: +# - develop +# - master +# pull_request: +# branches: +# - develop +# - master +# +#jobs: +# mac-os-build-clang: +# runs-on: macos-13 +# env: +# AWS_KVS_LOG_LEVEL: 2 +# permissions: +# id-token: write +# contents: read +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# brew install pkg-config openssl cmake gstreamer log4cplus +# brew unlink openssl +# - name: Build repository +# run: | +# mkdir build && cd build +# sh -c 'cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE;cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE -DCMAKE_INSTALL_PREFIX=.' +# make +# make install +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# cd build +# ./tst/producerTest +# +# mac-os-build-gcc: +# runs-on: macos-13 +# permissions: +# id-token: write +# contents: read +# env: +# CC: gcc +# CXX: g++ +# AWS_KVS_LOG_LEVEL: 2 +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# brew install pkg-config openssl cmake gstreamer log4cplus +# brew unlink openssl +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# cd build +# ./tst/producerTest +# +# linux-gcc-code-coverage: +# runs-on: ubuntu-20.04 +# env: +# AWS_KVS_LOG_LEVEL: 2 +# permissions: +# id-token: write +# contents: read +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# cd build +# ulimit -c unlimited -S +# timeout --signal=SIGABRT 60m ./tst/producerTest +# - name: Code coverage +# run: | +# cd build +# for test_file in $(find CMakeFiles/KinesisVideoProducer.dir gstkvssink.dir KinesisVideoProducerJNI.dir -name '*.gcno'); do gcov $test_file; done +# bash <(curl -s https://codecov.io/bash) +# +# address-sanitizer: +# runs-on: ubuntu-20.04 +# permissions: +# id-token: write +# contents: read +# env: +# CC: clang +# CXX: clang++ +# AWS_KVS_LOG_LEVEL: 2 +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# cd build +# ulimit -c unlimited -S +# timeout --signal=SIGABRT 60m ./tst/producerTest +# +# undefined-behavior-sanitizer: +# runs-on: ubuntu-20.04 +# permissions: +# id-token: write +# contents: read +# env: +# CC: clang +# CXX: clang++ +# AWS_KVS_LOG_LEVEL: 2 +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# cd build +# ulimit -c unlimited -S +# timeout --signal=SIGABRT 60m ./tst/producerTest +# +# # memory-sanitizer: +# # runs-on: ubuntu-20.04 +# # permissions: +# # id-token: write +# # contents: read +# # env: +# # CC: clang +# # CXX: clang++ +# # AWS_KVS_LOG_LEVEL: 2 +# # steps: +# # - name: Clone repository +# # uses: actions/checkout@v3 +# # - name: Configure AWS Credentials +# # uses: aws-actions/configure-aws-credentials@v1-node16 +# # with: +# # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# # role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# # aws-region: ${{ secrets.AWS_REGION }} +# # - name: Build repository +# # run: | +# # mkdir build && cd build +# # cmake .. -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE +# # make +# # ulimit -c unlimited -S +# # timeout --signal=SIGABRT 150m ./tst/producerTest --gtest_break_on_failure +# # thread-sanitizer: +# # runs-on: ubuntu-20.04 +# # permissions: +# # id-token: write +# # contents: read +# # env: +# # CC: clang +# # CXX: clang++ +# # AWS_KVS_LOG_LEVEL: 2 +# # steps: +# # - name: Clone repository +# # uses: actions/checkout@v3 +# # - name: Configure AWS Credentials +# # uses: aws-actions/configure-aws-credentials@v1-node16 +# # with: +# # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# # role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# # aws-region: ${{ secrets.AWS_REGION }} +# # - name: Build repository +# # run: | +# # sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# # mkdir build && cd build +# # cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE +# # make +# # ulimit -c unlimited -S +# # timeout --signal=SIGABRT 20m ./tst/producerTest +# +# ubuntu-gcc: +# runs-on: ubuntu-20.04 +# env: +# AWS_KVS_LOG_LEVEL: 2 +# CC: gcc +# CXX: g++ +# permissions: +# id-token: write +# contents: read +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# cd build +# ulimit -c unlimited -S +# timeout --signal=SIGABRT 60m ./tst/producerTest +# +# windows-msvc: +# runs-on: windows-2022 +# env: +# AWS_KVS_LOG_LEVEL: 7 +# permissions: +# id-token: write +# contents: read +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Move repository +# run: | +# mkdir C:\producer +# Move-Item -Path "D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\*" -Destination "D:\producer" +# - name: Install dependencies +# run: | +# choco install nasm strawberryperl +# choco install gstreamer --version=1.22.8 +# choco install gstreamer-devel --version=1.22.8 +# - name: Build repository +# run: | +# $env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin' +# git config --system core.longpaths true +# cd D:\producer +# dir +# .\build_windows.bat +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1-node16 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# - name: Run tests +# run: | +# $env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin' +# & "D:\producer\build\tst\producerTest.exe" +# +# arm64-cross-compilation: +# runs-on: ubuntu-20.04 +# env: +# CC: aarch64-linux-gnu-gcc +# CXX: aarch64-linux-gnu-g++ +# steps: +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +# sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Build Repository +# run: | +# sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic64 -DBUILD_LOG4CPLUS_HOST=arm-linux -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# file libKinesisVideoProducer.so +# +# linux-aarch64-cross-compilation: +# runs-on: ubuntu-20.04 +# env: +# CC: aarch64-linux-gnu-gcc +# CXX: aarch64-linux-gnu-g++ +# steps: +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +# sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Build Repository +# run: | +# sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DBUILD_OPENSSL_PLATFORM=linux-aarch64 -DBUILD_LOG4CPLUS_HOST=arm-linux -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# file libKinesisVideoProducer.so +# +# arm32-cross-compilation: +# runs-on: ubuntu-20.04 +# env: +# CC: arm-linux-gnueabi-gcc +# CXX: arm-linux-gnueabi-g++ +# steps: +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get -y install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi +# sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Build Repository +# run: | +# sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' +# mkdir build && cd build +# cmake .. -DBUILD_TEST=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic32 -DBUILD_LOG4CPLUS_HOST=arm-linux -DCMAKE_INSTALL_PREFIX=. +# make +# make install +# file libKinesisVideoProducer.so +# +# linux-build-gcc-static: +# runs-on: ubuntu-20.04 +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_STATIC=ON +# make +# +# linux-build-gcc-shared: +# runs-on: ubuntu-20.04 +# steps: +# - name: Clone repository +# uses: actions/checkout@v3 +# - name: Install dependencies +# run: | +# sudo apt clean && sudo apt update +# sudo apt install -y libunwind-dev +# sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools +# - name: Build repository +# run: | +# mkdir build && cd build +# cmake .. -DBUILD_DEPENDENCIES=OFF -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_STATIC=OFF -DBUILD_SHARED_LIBS=ON +# make diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f2fa5f73..d77606ab 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,67 +1,67 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. +## For most projects, this workflow file will not need changing; you simply need +## to commit it to your repository. +## +## You may wish to alter this file to override the set of languages analyzed, +## or to provide custom queries or build logic. +## +## ******** NOTE ******** +## We have attempted to detect the languages in your repository. Please check +## the `language` matrix defined below to confirm you have the correct set of +## supported CodeQL languages. +## +#name: "CodeQL" # -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. +#on: +# push: +# branches: [ master, develop ] +# pull_request: +# # The branches below must be a subset of the branches above +# branches: [ master, develop ] +# schedule: +# - cron: '41 13 * * 2' # -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. +#jobs: +# analyze: +# name: Analyze +# runs-on: ubuntu-latest # -name: "CodeQL" - -on: - push: - branches: [ master, develop ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master, develop ] - schedule: - - cron: '41 13 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 +# strategy: +# fail-fast: false +# matrix: +# language: [ 'cpp' ] +# # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] +# # Learn more: +# # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed +# +# steps: +# - name: Checkout repository +# uses: actions/checkout@v3 +# +# # Initializes the CodeQL tools for scanning. +# - name: Initialize CodeQL +# uses: github/codeql-action/init@v2 +# with: +# languages: ${{ matrix.language }} +# # If you wish to specify custom queries, you can do so here or in a config file. +# # By default, queries listed here will override any specified in a config file. +# # Prefix the list here with "+" to use these queries and those in the config file. +# # queries: ./path/to/local/query, your-org/your-repo/queries@main +# +# # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). +# # If this step fails, then you should remove it and run the build manually (see below) +# - name: Autobuild +# uses: github/codeql-action/autobuild@v2 +# +# # ℹī¸ Command-line programs to run using the OS shell. +# # 📚 https://git.io/JvXDl +# +# # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines +# # and modify them (or add more) to build your code if your project +# # uses a compiled language +# +# #- run: | +# # make bootstrap +# # make release +# +# - name: Perform CodeQL Analysis +# uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/raspberry-pi.yaml b/.github/workflows/raspberry-pi.yaml index 6d3c934d..1bbf15d1 100644 --- a/.github/workflows/raspberry-pi.yaml +++ b/.github/workflows/raspberry-pi.yaml @@ -1,93 +1,93 @@ -name: Build and test on Virtualized Raspberry Pi OS - -on: - push: - branches: [ master, develop ] - pull_request: - branches: [ master, develop ] - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 30 - permissions: - id-token: write - contents: read - strategy: - matrix: - include: - # Debian 11 - - os: bullseye - image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bullseye - # Debian 12 - - os: bookworm - image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bookworm - fail-fast: false - - name: Build on ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - - name: Build and Test - env: - AWS_KVS_LOG_LEVEL: 2 - run: | - docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \ - -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \ - -e AWS_SESSION_TOKEN -e AWS_REGION -e AWS_KVS_LOG_LEVEL \ - --platform linux/arm64 \ - ${{ matrix.image }} \ - /bin/bash -c ' - set -ex - apt-get update - apt-get install -y automake build-essential cmake git \ - gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-omx-generic \ - libcurl4-openssl-dev libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev liblog4cplus-dev \ - libssl-dev pkg-config - - mkdir -p build - cd build - - cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON - make -j$(nproc) - - export GST_PLUGIN_PATH=$(pwd) - - set +e # Disable exit on error for the timeout command - timeout --preserve-status --signal=SIGINT --kill-after=15s 30s \ - gst-launch-1.0 -v videotestsrc is-live=true \ - ! video/x-raw,framerate=10/1,width=640,height=480 \ - ! clockoverlay time-format="%a %B %d, %Y %I:%M:%S %p" \ - ! x264enc bframes=0 key-int-max=10 tune=zerolatency \ - ! h264parse \ - ! kvssink stream-name="cpp-producer-rpi-${{ matrix.os }}" - EXIT_CODE=$? - set -e # Re-enable exit on error - - # 0: Process exited after interrupt with code 0 - # 1: Process exited with error code 1 - # 137: Process killed by SIGKILL (if the --kill-after timeout is reached) - echo "Command exited with code: $EXIT_CODE" - if [ $EXIT_CODE -ne 0 ]; then - echo "Command did not exit gracefully after interrupt." - exit 1 - fi - ' +#name: Build and test on Virtualized Raspberry Pi OS +# +#on: +# push: +# branches: [ master, develop ] +# pull_request: +# branches: [ master, develop ] +# +#jobs: +# build: +# runs-on: ubuntu-latest +# timeout-minutes: 30 +# permissions: +# id-token: write +# contents: read +# strategy: +# matrix: +# include: +# # Debian 11 +# - os: bullseye +# image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bullseye +# # Debian 12 +# - os: bookworm +# image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bookworm +# fail-fast: false +# +# name: Build on ${{ matrix.os }} +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v3 +# +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v4 +# with: +# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} +# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} +# aws-region: ${{ secrets.AWS_REGION }} +# role-duration-seconds: 10800 +# +# - name: Build and Test +# env: +# AWS_KVS_LOG_LEVEL: 2 +# run: | +# docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \ +# -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \ +# -e AWS_SESSION_TOKEN -e AWS_REGION -e AWS_KVS_LOG_LEVEL \ +# --platform linux/arm64 \ +# ${{ matrix.image }} \ +# /bin/bash -c ' +# set -ex +# apt-get update +# apt-get install -y automake build-essential cmake git \ +# gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad \ +# gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \ +# gstreamer1.0-tools gstreamer1.0-omx-generic \ +# libcurl4-openssl-dev libgstreamer1.0-dev \ +# libgstreamer-plugins-base1.0-dev liblog4cplus-dev \ +# libssl-dev pkg-config +# +# mkdir -p build +# cd build +# +# cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON +# make -j$(nproc) +# +# export GST_PLUGIN_PATH=$(pwd) +# +# set +e # Disable exit on error for the timeout command +# timeout --preserve-status --signal=SIGINT --kill-after=15s 30s \ +# gst-launch-1.0 -v videotestsrc is-live=true \ +# ! video/x-raw,framerate=10/1,width=640,height=480 \ +# ! clockoverlay time-format="%a %B %d, %Y %I:%M:%S %p" \ +# ! x264enc bframes=0 key-int-max=10 tune=zerolatency \ +# ! h264parse \ +# ! kvssink stream-name="cpp-producer-rpi-${{ matrix.os }}" +# EXIT_CODE=$? +# set -e # Re-enable exit on error +# +# # 0: Process exited after interrupt with code 0 +# # 1: Process exited with error code 1 +# # 137: Process killed by SIGKILL (if the --kill-after timeout is reached) +# echo "Command exited with code: $EXIT_CODE" +# if [ $EXIT_CODE -ne 0 ]; then +# echo "Command did not exit gracefully after interrupt." +# exit 1 +# fi +# ' diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml new file mode 100644 index 00000000..c80bf844 --- /dev/null +++ b/.github/workflows/samples.yml @@ -0,0 +1,172 @@ +name: Producer CPP Sample Checks + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +jobs: + sample-checks: + name: ${{ matrix.runner.id }} - ${{ matrix.sample.name }} + + strategy: + matrix: + sample: + - name: kvs_gstreamer_audio_video_sample + args: -f sample.mp4 + - name: kvs_gstreamer_file_uploader_sample + args: sample.mp4 0 audio-video +# - name: kvs_gstreamer_multistream_sample +# args: "" + - name: kvs_gstreamer_sample + args: sample.mp4 + - name: kvssink_gstreamer_sample + args: sample.mp4 + runner: + - id: macos-latest + image: macos-latest + + - id: ubuntu-22.04 + image: ubuntu-latest + docker: public.ecr.aws/ubuntu/ubuntu:22.04_stable + + - id: ubuntu-20.04 + image: ubuntu-latest + docker: public.ecr.aws/ubuntu/ubuntu:20.04_stable + + - id: windows-2022 + image: windows-2022 + + fail-fast: false + + runs-on: ${{ matrix.runner.image }} + container: ${{ matrix.runner.docker || '' }} + timeout-minutes: 30 + + env: + AWS_KVS_LOG_LEVEL: 2 + KVS_DEBUG_DUMP_DATA_FILE_DIR: ./debug_output + DEBIAN_FRONTEND: noninteractive + + permissions: + id-token: write + contents: read + + steps: + - name: Clone repository + uses: actions/checkout@v4 + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install gstreamer log4cplus mkvtoolnix + + - name: Install dependencies (Linux) + if: runner.os == 'Linux' + run: | + apt-get update + apt-get install -y git cmake build-essential pkg-config libssl-dev libcurl4-openssl-dev \ + liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-ugly gstreamer1.0-tools curl mkvtoolnix + + - name: Install dependencies (Windows) + if: runner.os == 'Windows' + run: | + choco install nasm strawberryperl pkgconfiglite mkvtoolnix + choco install gstreamer --version=1.22.8 + choco install gstreamer-devel --version=1.22.8 + + - name: Build samples (Linux & Mac) + if: runner.os == 'Linux' || runner.os == 'macOS' + run: | + mkdir build && cd build + mkdir -p $KVS_DEBUG_DUMP_DATA_FILE_DIR + cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF + make -j$(nproc) + + - name: Build samples (Windows) + if: runner.os == 'Windows' + shell: cmd + run: | + set PATH=%PATH%;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\a\amazon-kinesis-video-streams-producer-c\amazon-kinesis-video-streams-producer-c\open-source\lib;D:\a\amazon-kinesis-video-streams-producer-c\amazon-kinesis-video-streams-producer-c\open-source\bin + git config --system core.longpaths true + "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + mkdir build + cd build + cmd.exe /c cmake -G "NMake Makefiles" .. + cmake -G "NMake Makefiles" -DBUILD_GSTREAMER_PLUGIN=ON -DPKG_CONFIG_EXECUTABLE="D:\\gstreamer\\1.0\\msvc_x86_64\\bin\\pkg-config.exe" .. + nmake + mkdir "%KVS_DEBUG_DUMP_DATA_FILE_DIR%" + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} + aws-region: ${{ secrets.AWS_REGION }} + role-duration-seconds: 10800 + + - name: Run ${{ matrix.sample.name }} (Linux & Mac) + if: runner.os == 'Linux' || runner.os == 'macOS' + env: + GST_PLUGIN_PATH: ${{ github.workspace }}/build + KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output + working-directory: ./build + run: | + curl -fsSL -o sample.mp4 https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4 + ./${{ matrix.sample.name }} demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }} + + - name: Run ${{ matrix.sample.name }} (Windows) + if: runner.os == 'Windows' + env: + GST_PLUGIN_PATH: ${{ github.workspace }}/build + KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output + working-directory: ./build + run: | + $env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin;D:\gstreamer\1.0\msvc_x86_64\bin' + + Invoke-WebRequest -Uri https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4 -OutFile sample.mp4 + $exePath = Join-Path $PWD ${{ matrix.sample.name }} + & $exePath.exe demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }} + + - name: Verify MKV dump (Mac & Linux) + if: runner.os == 'Linux' || runner.os == 'macOS' + working-directory: ./build/debug_output + run: | + shopt -s nullglob # Ensure globbing works correctly and avoids errors when no files are found + + ls -tlrh + mkvfiles=(*.mkv) + if [ ${#mkvfiles[@]} -eq 0 ]; then + echo "No MKV files found in debug_output" + exit 1 + fi + + for file in "${mkvfiles[@]}"; do + echo "Verifying $file with mkvinfo (verbose and hexdump):" + mkvinfo -v -X "$file" + done + shell: bash + + - name: Verify MKV dump + if: runner.os == 'Windows' + working-directory: D:\producer\build + run: | + $env:Path += ";C:\Program Files\MKVToolNix" + dir debug_output + $mkvFiles = Get-ChildItem -Path "D:\producer\build\debug_output" -Filter *.mkv + if ($mkvFiles.Count -eq 0) { + Write-Error "No MKV files found in D:\producer\build\debug_output" + exit 1 + } + # Run mkvinfo on each MKV file + foreach ($file in $mkvFiles) { + Write-Output "Verifying $($file.FullName) with mkvinfo (verbose and hexdump):" + mkvinfo.exe -v -X "$($file.FullName)" + } diff --git a/samples/kvs_gstreamer_audio_video_sample.cpp b/samples/kvs_gstreamer_audio_video_sample.cpp index 38ea3837..4d6b9613 100644 --- a/samples/kvs_gstreamer_audio_video_sample.cpp +++ b/samples/kvs_gstreamer_audio_video_sample.cpp @@ -1011,7 +1011,7 @@ int main(int argc, char *argv[]) { if (argc < 2) { LOG_ERROR( - "Usage: AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET ./kinesis_video_gstreamer_audio_video_sample_app my-stream-name /path/to/file" + "Usage: AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET ./kinesis_video_gstreamer_audio_video_sample_app my-stream-name -f /path/to/file" "AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET ./kinesis_video_gstreamer_audio_video_sample_app my-stream-name"); return 1; }