From adb4c62a468a9c4da1a00a7cc4f98b7d7d6bb00d Mon Sep 17 00:00:00 2001 From: sirknightj Date: Tue, 4 Feb 2025 22:53:40 -0800 Subject: [PATCH] Add mac and linux as well --- .github/workflows/kvssink.yml | 135 +++++++++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kvssink.yml b/.github/workflows/kvssink.yml index 0eb120cd..5de80a88 100644 --- a/.github/workflows/kvssink.yml +++ b/.github/workflows/kvssink.yml @@ -82,6 +82,137 @@ jobs: # exit 1 # fi + mac-debug-dump-dir: + runs-on: macos-latest + env: + AWS_KVS_LOG_LEVEL: 1 + permissions: + id-token: write + contents: read + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Install dependencies + run: | + brew install pkg-config openssl cmake gstreamer log4cplus mkvtoolnix + + - name: Build kvssink + run: | + mkdir build && cd build + cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF + make -j$(nproc) + + - 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: ${{ github.workspace }}/build + KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output + working-directory: ./build + run: | + mkdir -p debug_output + gst-launch-1.0 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: ./build/debug_output + run: | + 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 + + linux-debug-dump-dir: + runs-on: ubuntu-latest + env: + AWS_KVS_LOG_LEVEL: 1 + permissions: + id-token: write + contents: read + strategy: + matrix: + include: + - os: Ubuntu 22.04 + image: public.ecr.aws/ubuntu/ubuntu:22.04_stable + - os: Ubuntu 20.04 + image: public.ecr.aws/ubuntu/ubuntu:20.04_stable + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo 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 \ + libcurl4-openssl-dev libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev liblog4cplus-dev \ + libssl-dev pkg-config mkvtoolnix + + - name: Setup build directory + run: | + mkdir -p build + cd build + + - name: Build kvssink + working-directory: ./build + run: | + cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DCMAKE_BUILD_TYPE=Debug -DALIGNED_MEMORY_MODEL=ON -DBUILD_DEPENDENCIES=OFF + make -j$(nproc) + + - 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: ${{ github.workspace }}/build + KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output + working-directory: ./build + run: | + mkdir -p debug_output + gst-launch-1.0 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: ./build/debug_output + run: | + 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 + windows-debug-dump-dir: runs-on: windows-2022 env: @@ -141,6 +272,6 @@ jobs: # Run mkvinfo on each MKV file foreach ($file in $mkvFiles) { - Write-Output "Verifying $($file.FullName) with mkvinfo:" - mkvinfo.exe "$($file.FullName)" + Write-Output "Verifying $($file.FullName) with mkvinfo (verbose and hexdump):" + mkvinfo.exe -v -X "$($file.FullName)" }