|
| 1 | +name: Producer CPP Sample Checks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + - master |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - develop |
| 11 | + - master |
| 12 | + |
| 13 | +jobs: |
| 14 | + sample-checks: |
| 15 | + name: ${{ matrix.runner.id }} - ${{ matrix.sample-executable }} |
| 16 | + |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + sample-executable: |
| 20 | + - kvs_gstreamer_audio_video_sample |
| 21 | + - kvs_gstreamer_file_uploader_sample |
| 22 | + - kvs_gstreamer_multistream_sample |
| 23 | + - kvs_gstreamer_sample |
| 24 | + - kvssink_gstreamer_sample |
| 25 | + runner: |
| 26 | + - id: macos-latest |
| 27 | + image: macos-latest |
| 28 | + |
| 29 | + - id: ubuntu-22.04 |
| 30 | + image: ubuntu-latest |
| 31 | + docker: public.ecr.aws/ubuntu/ubuntu:22.04_stable |
| 32 | + |
| 33 | + - id: ubuntu-20.04 |
| 34 | + image: ubuntu-latest |
| 35 | + docker: public.ecr.aws/ubuntu/ubuntu:20.04_stable |
| 36 | + |
| 37 | + - id: windows-2022 |
| 38 | + image: windows-2022 |
| 39 | + |
| 40 | + fail-fast: false |
| 41 | + |
| 42 | + runs-on: ${{ matrix.runner.image }} |
| 43 | + container: ${{ matrix.runner.docker || '' }} |
| 44 | + timeout-minutes: 30 |
| 45 | + |
| 46 | + env: |
| 47 | + AWS_KVS_LOG_LEVEL: 2 |
| 48 | + KVS_DEBUG_DUMP_DATA_FILE_DIR: ./debug_output |
| 49 | + DEBIAN_FRONTEND: noninteractive |
| 50 | + |
| 51 | + permissions: |
| 52 | + id-token: write |
| 53 | + contents: read |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Clone repository |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Install dependencies (macOS) |
| 60 | + if: runner.os == 'macOS' |
| 61 | + run: | |
| 62 | + brew install gstreamer log4cplus mkvtoolnix |
| 63 | +
|
| 64 | + - name: Install dependencies (Linux) |
| 65 | + if: runner.os == 'Linux' |
| 66 | + run: | |
| 67 | + apt-get update |
| 68 | + apt-get install -y git cmake build-essential pkg-config libssl-dev libcurl4-openssl-dev \ |
| 69 | + liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ |
| 70 | + gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good \ |
| 71 | + gstreamer1.0-plugins-ugly gstreamer1.0-tools mkvtoolnix |
| 72 | +
|
| 73 | + - name: Install dependencies (Windows) |
| 74 | + if: runner.os == 'Windows' |
| 75 | + run: | |
| 76 | + choco install nasm strawberryperl pkgconfiglite |
| 77 | +
|
| 78 | + - name: Build samples (Linux & Mac) |
| 79 | + if: runner.os == 'Linux' || runner.os == 'macOS' |
| 80 | + run: | |
| 81 | + mkdir build && cd build |
| 82 | + cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_SAMPLES=ON -DBUILD_DEPENDENCIES=OFF |
| 83 | + make -j$(nproc) |
| 84 | +
|
| 85 | + - name: Build samples (Windows) |
| 86 | + if: runner.os == 'Windows' |
| 87 | + run: | |
| 88 | + $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-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' |
| 89 | + git config --system core.longpaths true |
| 90 | + .github/build_windows.bat |
| 91 | +
|
| 92 | + - name: Configure AWS Credentials |
| 93 | + uses: aws-actions/configure-aws-credentials@v4 |
| 94 | + with: |
| 95 | + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} |
| 96 | + role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} |
| 97 | + aws-region: ${{ secrets.AWS_REGION }} |
| 98 | + role-duration-seconds: 10800 |
| 99 | + |
| 100 | + - name: Run ${{ matrix.sample-executable }} (Linux & Mac) |
| 101 | + if: runner.os == 'Linux' || runner.os == 'macOS' |
| 102 | + env: |
| 103 | + GST_PLUGIN_PATH: ${{ github.workspace }}/build |
| 104 | + KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output |
| 105 | + working-directory: ./build |
| 106 | + run: | |
| 107 | + mkdir -p debug_output |
| 108 | + ./${{ matrix.sample-executable }} demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample-executable }} |
| 109 | +
|
| 110 | + - name: Run ${{ matrix.sample-executable }} (Windows) |
| 111 | + if: runner.os == 'Windows' |
| 112 | + env: |
| 113 | + GST_PLUGIN_PATH: ${{ github.workspace }}/build |
| 114 | + KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output |
| 115 | + working-directory: ./build |
| 116 | + run: | |
| 117 | + New-Item -ItemType Directory -Path $env:KVS_DEBUG_DUMP_DATA_FILE_DIR -Force |
| 118 | + |
| 119 | + $exePath = Join-Path $PWD ${{ matrix.sample-executable }} |
| 120 | + & $exePath demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample-executable }} |
| 121 | +
|
| 122 | + - name: Verify MKV dump |
| 123 | + working-directory: ./build/debug_output |
| 124 | + run: | |
| 125 | + mkvfiles=(*.mkv) |
| 126 | + if [ ${#mkvfiles[@]} -eq 0 ]; then |
| 127 | + echo "No MKV files found in debug_output" |
| 128 | + exit 1 |
| 129 | + fi |
| 130 | + |
| 131 | + for file in "${mkvfiles[@]}"; do |
| 132 | + echo "Verifying $file with mkvinfo (verbose and hexdump):" |
| 133 | + mkvinfo -v -X "$file" |
| 134 | + done |
0 commit comments