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