diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f0a62f..3abc1edb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: role-duration-seconds: 10800 - name: Run tests run: | - cd build + cd build ./tst/producerTest mac-os-build-gcc: @@ -73,10 +73,10 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} role-duration-seconds: 10800 - name: Run tests - run: | + run: | cd build ./tst/producerTest - + linux-gcc-code-coverage: runs-on: ubuntu-20.04 env: @@ -88,7 +88,7 @@ jobs: - name: Clone repository uses: actions/checkout@v3 - name: Install dependencies - run: | + 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 @@ -115,7 +115,7 @@ jobs: 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: @@ -189,7 +189,7 @@ jobs: timeout --signal=SIGABRT 60m ./tst/producerTest # memory-sanitizer: - # runs-on: ubuntu-20.04 + # runs-on: ubuntu-20.04 # permissions: # id-token: write # contents: read @@ -237,9 +237,9 @@ jobs: # mkdir build && cd build # cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE -DBUILD_GSTREAMER_PLUGIN=TRUE -DBUILD_JNI=TRUE # make - # ulimit -c unlimited -S + # ulimit -c unlimited -S # timeout --signal=SIGABRT 20m ./tst/producerTest - + ubuntu-gcc: runs-on: ubuntu-20.04 env: @@ -312,7 +312,7 @@ jobs: - 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" + & "D:\producer\build\tst\producerTest.exe" arm64-cross-compilation: runs-on: ubuntu-20.04 diff --git a/.github/workflows/kvssink.yml b/.github/workflows/kvssink.yml index 017f2f51..0eb120cd 100644 --- a/.github/workflows/kvssink.yml +++ b/.github/workflows/kvssink.yml @@ -65,19 +65,82 @@ jobs: working-directory: ./build run: | export GST_PLUGIN_PATH=`pwd` - GST_DEBUG=4 ./tst/gstkvsplugintest + GST_DEBUG=4 ./tst/gstkvsplugintest - - name: Run the unit tests with valgrind - working-directory: ./build +# - name: Run the unit tests with valgrind +# working-directory: ./build +# run: | +# export GST_PLUGIN_PATH=`pwd` +# valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \ +# --verbose --log-file=valgrind-out.txt ./tst/gstkvsplugintest +# +# if grep -q "All heap blocks were freed -- no leaks are possible" valgrind-out.txt; then +# echo "No memory leaks detected" +# else +# echo "Memory leaks detected. Review the valgrind output:" +# cat valgrind-out.txt +# exit 1 +# fi + + windows-debug-dump-dir: + runs-on: windows-2022 + env: + AWS_KVS_LOG_LEVEL: 1 + permissions: + id-token: write + contents: read + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Move repository run: | - export GST_PLUGIN_PATH=`pwd` - valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \ - --verbose --log-file=valgrind-out.txt ./tst/gstkvsplugintest + mkdir D:\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 mkvtoolnix + 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 + .github\build_windows.bat + - 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 kvssink with dump dir + env: + GST_PLUGIN_PATH: D:\producer\build\ + KVS_DEBUG_DUMP_DATA_FILE_DIR: D:\producer\build\debug_output + working-directory: D:\producer\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' + + # Create the debug directory (equivalent to mkdir -p) + New-Item -ItemType Directory -Path "D:\producer\build\debug_output" -Force + + # Stream for 15 seconds (450 frames @ 30 fps) + gst-launch-1.0.exe videotestsrc is-live=true num-buffers=450 ! video/x-raw,framerate=30/1,width=640,height=480 ! videoconvert ! x264enc tune=zerolatency key-int-max=45 ! h264parse ! kvssink stream-name="demo-stream" + - name: Verify MKV dump + working-directory: D:\producer\build + run: | + $env:Path += ";C:\Program Files\MKVToolNix" + $mkvFiles = Get-ChildItem -Path "D:\producer\build\debug_output" -Filter *.mkv - if grep -q "All heap blocks were freed -- no leaks are possible" valgrind-out.txt; then - echo "No memory leaks detected" - else - echo "Memory leaks detected. Review the valgrind output:" - cat valgrind-out.txt + if ($mkvFiles.Count -eq 0) { + Write-Error "No MKV files found in D:\producer\build\debug_output" exit 1 - fi + } + + # Run mkvinfo on each MKV file + foreach ($file in $mkvFiles) { + Write-Output "Verifying $($file.FullName) with mkvinfo:" + mkvinfo.exe "$($file.FullName)" + } diff --git a/.github/workflows/raspberry-pi.yaml b/.github/workflows/raspberry-pi.yaml index 6d3c934d..b3aec002 100644 --- a/.github/workflows/raspberry-pi.yaml +++ b/.github/workflows/raspberry-pi.yaml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 30 permissions: id-token: write @@ -70,7 +70,7 @@ jobs: 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 \ @@ -81,10 +81,10 @@ jobs: ! 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) + # 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."